@@ -11,7 +11,7 @@ use crate::lint::{
1111} ;
1212use crate :: Session ;
1313use rustc_ast:: node_id:: NodeId ;
14- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
14+ use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
1515use rustc_data_structures:: sync:: { AppendOnlyVec , Lock , Lrc } ;
1616use rustc_errors:: { emitter:: SilentEmitter , DiagCtxt } ;
1717use rustc_errors:: {
@@ -30,7 +30,7 @@ use std::str;
3030/// used and should be feature gated accordingly in `check_crate`.
3131#[ derive( Default ) ]
3232pub struct GatedSpans {
33- pub spans : Lock < FxHashMap < Symbol , Vec < Span > > > ,
33+ pub spans : Lock < FxIndexMap < Symbol , Vec < Span > > > ,
3434}
3535
3636impl GatedSpans {
@@ -50,12 +50,9 @@ impl GatedSpans {
5050 }
5151
5252 /// 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 > > ) {
5454 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 ( ..) {
5956 spans. entry ( gate) . or_default ( ) . append ( & mut gate_spans) ;
6057 }
6158 * inner = spans;
@@ -65,7 +62,7 @@ impl GatedSpans {
6562#[ derive( Default ) ]
6663pub struct SymbolGallery {
6764 /// All symbols occurred and their first occurrence span.
68- pub symbols : Lock < FxHashMap < Symbol , Span > > ,
65+ pub symbols : Lock < FxIndexMap < Symbol , Span > > ,
6966}
7067
7168impl SymbolGallery {
@@ -205,19 +202,19 @@ pub struct ParseSess {
205202 /// Places where identifiers that contain invalid Unicode codepoints but that look like they
206203 /// should be. Useful to avoid bad tokenization when encountering emoji. We group them to
207204 /// 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 > > > ,
209206 source_map : Lrc < SourceMap > ,
210207 pub buffered_lints : Lock < Vec < BufferedEarlyLint > > ,
211208 /// Contains the spans of block expressions that could have been incomplete based on the
212209 /// operation token that followed it, but that the parser cannot identify without further
213210 /// analysis.
214- pub ambiguous_block_expr_parse : Lock < FxHashMap < Span , Span > > ,
211+ pub ambiguous_block_expr_parse : Lock < FxIndexMap < Span , Span > > ,
215212 pub gated_spans : GatedSpans ,
216213 pub symbol_gallery : SymbolGallery ,
217214 /// 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 > ) > > ,
219216 /// File paths accessed during the build.
220- pub file_depinfo : Lock < FxHashSet < Symbol > > ,
217+ pub file_depinfo : Lock < FxIndexSet < Symbol > > ,
221218 /// Whether cfg(version) should treat the current release as incomplete
222219 pub assume_incomplete_release : bool ,
223220 /// Spans passed to `proc_macro::quote_span`. Each span has a numerical
@@ -247,7 +244,7 @@ impl ParseSess {
247244 bad_unicode_identifiers : Lock :: new ( Default :: default ( ) ) ,
248245 source_map,
249246 buffered_lints : Lock :: new ( vec ! [ ] ) ,
250- ambiguous_block_expr_parse : Lock :: new ( FxHashMap :: default ( ) ) ,
247+ ambiguous_block_expr_parse : Lock :: new ( Default :: default ( ) ) ,
251248 gated_spans : GatedSpans :: default ( ) ,
252249 symbol_gallery : SymbolGallery :: default ( ) ,
253250 env_depinfo : Default :: default ( ) ,
0 commit comments