@@ -44,20 +44,20 @@ extern crate tracing;
44
44
45
45
use crate :: errors:: { AssocTyParentheses , AssocTyParenthesesSub , MisplacedImplTrait } ;
46
46
47
+ use rustc_ast:: node_id:: NodeMap ;
47
48
use rustc_ast:: ptr:: P ;
48
49
use rustc_ast:: { self as ast, * } ;
49
50
use rustc_ast_pretty:: pprust;
50
51
use rustc_data_structures:: captures:: Captures ;
51
52
use rustc_data_structures:: fingerprint:: Fingerprint ;
52
- use rustc_data_structures:: fx:: FxHashMap ;
53
53
use rustc_data_structures:: sorted_map:: SortedMap ;
54
54
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
55
55
use rustc_data_structures:: sync:: Lrc ;
56
56
use rustc_errors:: { DiagnosticArgFromDisplay , StashKey } ;
57
57
use rustc_hir as hir;
58
58
use rustc_hir:: def:: { DefKind , LifetimeRes , Namespace , PartialRes , PerNS , Res } ;
59
- use rustc_hir:: def_id:: { LocalDefId , CRATE_DEF_ID , LOCAL_CRATE } ;
60
- use rustc_hir:: { ConstArg , GenericArg , ItemLocalId , ParamName , TraitCandidate } ;
59
+ use rustc_hir:: def_id:: { LocalDefId , LocalDefIdMap , CRATE_DEF_ID , LOCAL_CRATE } ;
60
+ use rustc_hir:: { ConstArg , GenericArg , ItemLocalMap , ParamName , TraitCandidate } ;
61
61
use rustc_index:: { Idx , IndexSlice , IndexVec } ;
62
62
use rustc_middle:: span_bug;
63
63
use rustc_middle:: ty:: { ResolverAstLowering , TyCtxt , Visibility } ;
@@ -119,13 +119,13 @@ struct LoweringContext<'a, 'hir> {
119
119
120
120
current_hir_id_owner : hir:: OwnerId ,
121
121
item_local_id_counter : hir:: ItemLocalId ,
122
- trait_map : FxHashMap < ItemLocalId , Box < [ TraitCandidate ] > > ,
122
+ trait_map : ItemLocalMap < Box < [ TraitCandidate ] > > ,
123
123
124
124
impl_trait_defs : Vec < hir:: GenericParam < ' hir > > ,
125
125
impl_trait_bounds : Vec < hir:: WherePredicate < ' hir > > ,
126
126
127
127
/// NodeIds that are lowered inside the current HIR owner.
128
- node_id_to_local_id : FxHashMap < NodeId , hir:: ItemLocalId > ,
128
+ node_id_to_local_id : NodeMap < hir:: ItemLocalId > ,
129
129
130
130
allow_try_trait : Lrc < [ Symbol ] > ,
131
131
allow_gen_future : Lrc < [ Symbol ] > ,
@@ -135,7 +135,7 @@ struct LoweringContext<'a, 'hir> {
135
135
/// For each captured lifetime (e.g., 'a), we create a new lifetime parameter that is a generic
136
136
/// defined on the TAIT, so we have type Foo<'a1> = ... and we establish a mapping in this
137
137
/// field from the original parameter 'a to the new parameter 'a1.
138
- generics_def_id_map : Vec < FxHashMap < LocalDefId , LocalDefId > > ,
138
+ generics_def_id_map : Vec < LocalDefIdMap < LocalDefId > > ,
139
139
140
140
host_param_id : Option < LocalDefId > ,
141
141
}
@@ -380,7 +380,7 @@ enum AstOwner<'a> {
380
380
}
381
381
382
382
fn index_crate < ' a > (
383
- node_id_to_def_id : & FxHashMap < NodeId , LocalDefId > ,
383
+ node_id_to_def_id : & NodeMap < LocalDefId > ,
384
384
krate : & ' a Crate ,
385
385
) -> IndexVec < LocalDefId , AstOwner < ' a > > {
386
386
let mut indexer = Indexer { node_id_to_def_id, index : IndexVec :: new ( ) } ;
@@ -390,7 +390,7 @@ fn index_crate<'a>(
390
390
return indexer. index ;
391
391
392
392
struct Indexer < ' s , ' a > {
393
- node_id_to_def_id : & ' s FxHashMap < NodeId , LocalDefId > ,
393
+ node_id_to_def_id : & ' s NodeMap < LocalDefId > ,
394
394
index : IndexVec < LocalDefId , AstOwner < ' a > > ,
395
395
}
396
396
@@ -642,7 +642,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
642
642
/// `'a` declared on the TAIT, instead of the function.
643
643
fn with_remapping < R > (
644
644
& mut self ,
645
- remap : FxHashMap < LocalDefId , LocalDefId > ,
645
+ remap : LocalDefIdMap < LocalDefId > ,
646
646
f : impl FnOnce ( & mut Self ) -> R ,
647
647
) -> R {
648
648
self . generics_def_id_map . push ( remap) ;
@@ -1657,7 +1657,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1657
1657
1658
1658
// Map from captured (old) lifetime to synthetic (new) lifetime.
1659
1659
// Used to resolve lifetimes in the bounds of the opaque.
1660
- let mut captured_to_synthesized_mapping = FxHashMap :: default ( ) ;
1660
+ let mut captured_to_synthesized_mapping = LocalDefIdMap :: default ( ) ;
1661
1661
// List of (early-bound) synthetic lifetimes that are owned by the opaque.
1662
1662
// This is used to create the `hir::Generics` owned by the opaque.
1663
1663
let mut synthesized_lifetime_definitions = vec ! [ ] ;
0 commit comments