@@ -11,7 +11,7 @@ use crate::lint::{
11
11
} ;
12
12
use crate :: Session ;
13
13
use rustc_ast:: node_id:: NodeId ;
14
- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
14
+ use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
15
15
use rustc_data_structures:: sync:: { AppendOnlyVec , Lock , Lrc } ;
16
16
use rustc_errors:: { emitter:: SilentEmitter , DiagCtxt } ;
17
17
use rustc_errors:: {
@@ -30,7 +30,7 @@ use std::str;
30
30
/// used and should be feature gated accordingly in `check_crate`.
31
31
#[ derive( Default ) ]
32
32
pub struct GatedSpans {
33
- pub spans : Lock < FxHashMap < Symbol , Vec < Span > > > ,
33
+ pub spans : Lock < FxIndexMap < Symbol , Vec < Span > > > ,
34
34
}
35
35
36
36
impl GatedSpans {
@@ -50,12 +50,9 @@ impl GatedSpans {
50
50
}
51
51
52
52
/// Prepend the given set of `spans` onto the set in `self`.
53
- pub fn merge ( & self , mut spans : FxHashMap < Symbol , Vec < Span > > ) {
53
+ pub fn merge ( & self , mut spans : FxIndexMap < Symbol , Vec < Span > > ) {
54
54
let mut inner = self . spans . borrow_mut ( ) ;
55
- // The entries will be moved to another map so the drain order does not
56
- // matter.
57
- #[ allow( rustc:: potential_query_instability) ]
58
- for ( gate, mut gate_spans) in inner. drain ( ) {
55
+ for ( gate, mut gate_spans) in inner. drain ( ..) {
59
56
spans. entry ( gate) . or_default ( ) . append ( & mut gate_spans) ;
60
57
}
61
58
* inner = spans;
@@ -65,7 +62,7 @@ impl GatedSpans {
65
62
#[ derive( Default ) ]
66
63
pub struct SymbolGallery {
67
64
/// All symbols occurred and their first occurrence span.
68
- pub symbols : Lock < FxHashMap < Symbol , Span > > ,
65
+ pub symbols : Lock < FxIndexMap < Symbol , Span > > ,
69
66
}
70
67
71
68
impl SymbolGallery {
@@ -205,19 +202,19 @@ pub struct ParseSess {
205
202
/// Places where identifiers that contain invalid Unicode codepoints but that look like they
206
203
/// should be. Useful to avoid bad tokenization when encountering emoji. We group them to
207
204
/// provide a single error per unique incorrect identifier.
208
- pub bad_unicode_identifiers : Lock < FxHashMap < Symbol , Vec < Span > > > ,
205
+ pub bad_unicode_identifiers : Lock < FxIndexMap < Symbol , Vec < Span > > > ,
209
206
source_map : Lrc < SourceMap > ,
210
207
pub buffered_lints : Lock < Vec < BufferedEarlyLint > > ,
211
208
/// Contains the spans of block expressions that could have been incomplete based on the
212
209
/// operation token that followed it, but that the parser cannot identify without further
213
210
/// analysis.
214
- pub ambiguous_block_expr_parse : Lock < FxHashMap < Span , Span > > ,
211
+ pub ambiguous_block_expr_parse : Lock < FxIndexMap < Span , Span > > ,
215
212
pub gated_spans : GatedSpans ,
216
213
pub symbol_gallery : SymbolGallery ,
217
214
/// Environment variables accessed during the build and their values when they exist.
218
- pub env_depinfo : Lock < FxHashSet < ( Symbol , Option < Symbol > ) > > ,
215
+ pub env_depinfo : Lock < FxIndexSet < ( Symbol , Option < Symbol > ) > > ,
219
216
/// File paths accessed during the build.
220
- pub file_depinfo : Lock < FxHashSet < Symbol > > ,
217
+ pub file_depinfo : Lock < FxIndexSet < Symbol > > ,
221
218
/// Whether cfg(version) should treat the current release as incomplete
222
219
pub assume_incomplete_release : bool ,
223
220
/// Spans passed to `proc_macro::quote_span`. Each span has a numerical
@@ -247,7 +244,7 @@ impl ParseSess {
247
244
bad_unicode_identifiers : Lock :: new ( Default :: default ( ) ) ,
248
245
source_map,
249
246
buffered_lints : Lock :: new ( vec ! [ ] ) ,
250
- ambiguous_block_expr_parse : Lock :: new ( FxHashMap :: default ( ) ) ,
247
+ ambiguous_block_expr_parse : Lock :: new ( Default :: default ( ) ) ,
251
248
gated_spans : GatedSpans :: default ( ) ,
252
249
symbol_gallery : SymbolGallery :: default ( ) ,
253
250
env_depinfo : Default :: default ( ) ,
0 commit comments