11use crate :: path_utils:: allow_two_phase_borrow;
22use crate :: place_ext:: PlaceExt ;
33use crate :: BorrowIndex ;
4- use rustc_data_structures:: fx :: { FxIndexMap , FxIndexSet } ;
4+ use rustc_data_structures:: gx :: { GxIndexMap , GxIndexSet } ;
55use rustc_index:: bit_set:: BitSet ;
66use rustc_middle:: mir:: traversal;
77use rustc_middle:: mir:: visit:: { MutatingUseContext , NonUseContext , PlaceContext , Visitor } ;
@@ -18,16 +18,16 @@ pub struct BorrowSet<'tcx> {
1818 /// by the `Location` of the assignment statement in which it
1919 /// appears on the right hand side. Thus the location is the map
2020 /// key, and its position in the map corresponds to `BorrowIndex`.
21- pub location_map : FxIndexMap < Location , BorrowData < ' tcx > > ,
21+ pub location_map : GxIndexMap < Location , BorrowData < ' tcx > > ,
2222
2323 /// Locations which activate borrows.
2424 /// NOTE: a given location may activate more than one borrow in the future
2525 /// when more general two-phase borrow support is introduced, but for now we
2626 /// only need to store one borrow index.
27- pub activation_map : FxIndexMap < Location , Vec < BorrowIndex > > ,
27+ pub activation_map : GxIndexMap < Location , Vec < BorrowIndex > > ,
2828
2929 /// Map from local to all the borrows on that local.
30- pub local_map : FxIndexMap < mir:: Local , FxIndexSet < BorrowIndex > > ,
30+ pub local_map : GxIndexMap < mir:: Local , GxIndexSet < BorrowIndex > > ,
3131
3232 pub locals_state_at_exit : LocalsStateAtExit ,
3333}
@@ -174,9 +174,9 @@ impl<'tcx> BorrowSet<'tcx> {
174174struct GatherBorrows < ' a , ' tcx > {
175175 tcx : TyCtxt < ' tcx > ,
176176 body : & ' a Body < ' tcx > ,
177- location_map : FxIndexMap < Location , BorrowData < ' tcx > > ,
178- activation_map : FxIndexMap < Location , Vec < BorrowIndex > > ,
179- local_map : FxIndexMap < mir:: Local , FxIndexSet < BorrowIndex > > ,
177+ location_map : GxIndexMap < Location , BorrowData < ' tcx > > ,
178+ activation_map : GxIndexMap < Location , Vec < BorrowIndex > > ,
179+ local_map : GxIndexMap < mir:: Local , GxIndexSet < BorrowIndex > > ,
180180
181181 /// When we encounter a 2-phase borrow statement, it will always
182182 /// be assigning into a temporary TEMP:
@@ -186,7 +186,7 @@ struct GatherBorrows<'a, 'tcx> {
186186 /// We add TEMP into this map with `b`, where `b` is the index of
187187 /// the borrow. When we find a later use of this activation, we
188188 /// remove from the map (and add to the "tombstone" set below).
189- pending_activations : FxIndexMap < mir:: Local , BorrowIndex > ,
189+ pending_activations : GxIndexMap < mir:: Local , BorrowIndex > ,
190190
191191 locals_state_at_exit : LocalsStateAtExit ,
192192}
0 commit comments