1
1
use crate :: path_utils:: allow_two_phase_borrow;
2
2
use crate :: place_ext:: PlaceExt ;
3
3
use crate :: BorrowIndex ;
4
- use rustc_data_structures:: fx :: { FxIndexMap , FxIndexSet } ;
4
+ use rustc_data_structures:: gx :: { GxIndexMap , GxIndexSet } ;
5
5
use rustc_index:: bit_set:: BitSet ;
6
6
use rustc_middle:: mir:: traversal;
7
7
use rustc_middle:: mir:: visit:: { MutatingUseContext , NonUseContext , PlaceContext , Visitor } ;
@@ -18,16 +18,16 @@ pub struct BorrowSet<'tcx> {
18
18
/// by the `Location` of the assignment statement in which it
19
19
/// appears on the right hand side. Thus the location is the map
20
20
/// 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 > > ,
22
22
23
23
/// Locations which activate borrows.
24
24
/// NOTE: a given location may activate more than one borrow in the future
25
25
/// when more general two-phase borrow support is introduced, but for now we
26
26
/// only need to store one borrow index.
27
- pub activation_map : FxIndexMap < Location , Vec < BorrowIndex > > ,
27
+ pub activation_map : GxIndexMap < Location , Vec < BorrowIndex > > ,
28
28
29
29
/// 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 > > ,
31
31
32
32
pub locals_state_at_exit : LocalsStateAtExit ,
33
33
}
@@ -174,9 +174,9 @@ impl<'tcx> BorrowSet<'tcx> {
174
174
struct GatherBorrows < ' a , ' tcx > {
175
175
tcx : TyCtxt < ' tcx > ,
176
176
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 > > ,
180
180
181
181
/// When we encounter a 2-phase borrow statement, it will always
182
182
/// be assigning into a temporary TEMP:
@@ -186,7 +186,7 @@ struct GatherBorrows<'a, 'tcx> {
186
186
/// We add TEMP into this map with `b`, where `b` is the index of
187
187
/// the borrow. When we find a later use of this activation, we
188
188
/// 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 > ,
190
190
191
191
locals_state_at_exit : LocalsStateAtExit ,
192
192
}
0 commit comments