22//! outside their scopes. This pass will also generate a set of exported items
33//! which are available for use externally when compiled as a library.
44use crate :: ty:: { TyCtxt , Visibility } ;
5- use rustc_data_structures:: fx:: FxHashMap ;
5+ use rustc_data_structures:: fx:: { FxIndexMap , IndexEntry } ;
66use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
77use rustc_hir:: def:: DefKind ;
88use rustc_macros:: HashStable ;
@@ -90,7 +90,7 @@ impl EffectiveVisibility {
9090/// Holds a map of effective visibilities for reachable HIR nodes.
9191#[ derive( Clone , Debug ) ]
9292pub struct EffectiveVisibilities < Id = LocalDefId > {
93- map : FxHashMap < Id , EffectiveVisibility > ,
93+ map : FxIndexMap < Id , EffectiveVisibility > ,
9494}
9595
9696impl EffectiveVisibilities {
@@ -130,9 +130,8 @@ impl EffectiveVisibilities {
130130 eff_vis : & EffectiveVisibility ,
131131 tcx : TyCtxt < ' _ > ,
132132 ) {
133- use std:: collections:: hash_map:: Entry ;
134133 match self . map . entry ( def_id) {
135- Entry :: Occupied ( mut occupied) => {
134+ IndexEntry :: Occupied ( mut occupied) => {
136135 let old_eff_vis = occupied. get_mut ( ) ;
137136 for l in Level :: all_levels ( ) {
138137 let vis_at_level = eff_vis. at_level ( l) ;
@@ -145,7 +144,7 @@ impl EffectiveVisibilities {
145144 }
146145 old_eff_vis
147146 }
148- Entry :: Vacant ( vacant) => vacant. insert ( * eff_vis) ,
147+ IndexEntry :: Vacant ( vacant) => vacant. insert ( * eff_vis) ,
149148 } ;
150149 }
151150
0 commit comments