@@ -11,7 +11,7 @@ use crate::lint::{
1111} ;
1212use crate :: Session ;
1313use rustc_ast:: node_id:: NodeId ;
14- use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
14+ use rustc_data_structures:: fx:: { FxHashMap , 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 < FxIndexMap < Symbol , Vec < Span > > > ,
33+ pub spans : Lock < FxHashMap < Symbol , Vec < Span > > > ,
3434}
3535
3636impl GatedSpans {
@@ -50,9 +50,12 @@ impl GatedSpans {
5050 }
5151
5252 /// Prepend the given set of `spans` onto the set in `self`.
53- pub fn merge ( & self , mut spans : FxIndexMap < Symbol , Vec < Span > > ) {
53+ pub fn merge ( & self , mut spans : FxHashMap < Symbol , Vec < Span > > ) {
5454 let mut inner = self . spans . borrow_mut ( ) ;
55- for ( gate, mut gate_spans) in inner. drain ( ..) {
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 ( ) {
5659 spans. entry ( gate) . or_default ( ) . append ( & mut gate_spans) ;
5760 }
5861 * inner = spans;
@@ -62,7 +65,7 @@ impl GatedSpans {
6265#[ derive( Default ) ]
6366pub struct SymbolGallery {
6467 /// All symbols occurred and their first occurrence span.
65- pub symbols : Lock < FxIndexMap < Symbol , Span > > ,
68+ pub symbols : Lock < FxHashMap < Symbol , Span > > ,
6669}
6770
6871impl SymbolGallery {
0 commit comments