@@ -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:: { FxIndexMap , FxIndexSet } ;
14
+ use rustc_data_structures:: fx:: { FxHashMap , 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 < FxIndexMap < Symbol , Vec < Span > > > ,
33
+ pub spans : Lock < FxHashMap < Symbol , Vec < Span > > > ,
34
34
}
35
35
36
36
impl GatedSpans {
@@ -50,9 +50,12 @@ 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 : FxIndexMap < Symbol , Vec < Span > > ) {
53
+ pub fn merge ( & self , mut spans : FxHashMap < Symbol , Vec < Span > > ) {
54
54
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 ( ) {
56
59
spans. entry ( gate) . or_default ( ) . append ( & mut gate_spans) ;
57
60
}
58
61
* inner = spans;
@@ -62,7 +65,7 @@ impl GatedSpans {
62
65
#[ derive( Default ) ]
63
66
pub struct SymbolGallery {
64
67
/// All symbols occurred and their first occurrence span.
65
- pub symbols : Lock < FxIndexMap < Symbol , Span > > ,
68
+ pub symbols : Lock < FxHashMap < Symbol , Span > > ,
66
69
}
67
70
68
71
impl SymbolGallery {
0 commit comments