2
2
//! outside their scopes. This pass will also generate a set of exported items
3
3
//! which are available for use externally when compiled as a library.
4
4
use crate :: ty:: { TyCtxt , Visibility } ;
5
- use rustc_data_structures:: fx:: FxHashMap ;
5
+ use rustc_data_structures:: fx:: { FxIndexMap , IndexEntry } ;
6
6
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
7
7
use rustc_hir:: def:: DefKind ;
8
8
use rustc_macros:: HashStable ;
@@ -90,7 +90,7 @@ impl EffectiveVisibility {
90
90
/// Holds a map of effective visibilities for reachable HIR nodes.
91
91
#[ derive( Clone , Debug ) ]
92
92
pub struct EffectiveVisibilities < Id = LocalDefId > {
93
- map : FxHashMap < Id , EffectiveVisibility > ,
93
+ map : FxIndexMap < Id , EffectiveVisibility > ,
94
94
}
95
95
96
96
impl EffectiveVisibilities {
@@ -130,9 +130,8 @@ impl EffectiveVisibilities {
130
130
eff_vis : & EffectiveVisibility ,
131
131
tcx : TyCtxt < ' _ > ,
132
132
) {
133
- use std:: collections:: hash_map:: Entry ;
134
133
match self . map . entry ( def_id) {
135
- Entry :: Occupied ( mut occupied) => {
134
+ IndexEntry :: Occupied ( mut occupied) => {
136
135
let old_eff_vis = occupied. get_mut ( ) ;
137
136
for l in Level :: all_levels ( ) {
138
137
let vis_at_level = eff_vis. at_level ( l) ;
@@ -145,7 +144,7 @@ impl EffectiveVisibilities {
145
144
}
146
145
old_eff_vis
147
146
}
148
- Entry :: Vacant ( vacant) => vacant. insert ( * eff_vis) ,
147
+ IndexEntry :: Vacant ( vacant) => vacant. insert ( * eff_vis) ,
149
148
} ;
150
149
}
151
150
0 commit comments