@@ -16,7 +16,7 @@ use rustc::mir::traversal;
16
16
use rustc:: mir:: visit:: {
17
17
PlaceContext , Visitor , NonUseContext , MutatingUseContext , NonMutatingUseContext
18
18
} ;
19
- use rustc:: mir:: { self , Location , Mir , Place , Local } ;
19
+ use rustc:: mir:: { self , Location , Mir , Local } ;
20
20
use rustc:: ty:: { RegionVid , TyCtxt } ;
21
21
use rustc:: util:: nodemap:: { FxHashMap , FxHashSet } ;
22
22
use rustc_data_structures:: indexed_vec:: IndexVec ;
@@ -41,10 +41,6 @@ crate struct BorrowSet<'tcx> {
41
41
/// only need to store one borrow index
42
42
crate activation_map : FxHashMap < Location , Vec < BorrowIndex > > ,
43
43
44
- /// Every borrow has a region; this maps each such regions back to
45
- /// its borrow-indexes.
46
- crate region_map : FxHashMap < RegionVid , FxHashSet < BorrowIndex > > ,
47
-
48
44
/// Map from local to all the borrows on that local
49
45
crate local_map : FxHashMap < mir:: Local , FxHashSet < BorrowIndex > > ,
50
46
@@ -149,7 +145,6 @@ impl<'tcx> BorrowSet<'tcx> {
149
145
idx_vec : IndexVec :: new ( ) ,
150
146
location_map : Default :: default ( ) ,
151
147
activation_map : Default :: default ( ) ,
152
- region_map : Default :: default ( ) ,
153
148
local_map : Default :: default ( ) ,
154
149
pending_activations : Default :: default ( ) ,
155
150
locals_state_at_exit :
@@ -164,7 +159,6 @@ impl<'tcx> BorrowSet<'tcx> {
164
159
borrows : visitor. idx_vec ,
165
160
location_map : visitor. location_map ,
166
161
activation_map : visitor. activation_map ,
167
- region_map : visitor. region_map ,
168
162
local_map : visitor. local_map ,
169
163
locals_state_at_exit : visitor. locals_state_at_exit ,
170
164
}
@@ -184,7 +178,6 @@ struct GatherBorrows<'a, 'gcx: 'tcx, 'tcx: 'a> {
184
178
idx_vec : IndexVec < BorrowIndex , BorrowData < ' tcx > > ,
185
179
location_map : FxHashMap < Location , BorrowIndex > ,
186
180
activation_map : FxHashMap < Location , Vec < BorrowIndex > > ,
187
- region_map : FxHashMap < RegionVid , FxHashSet < BorrowIndex > > ,
188
181
local_map : FxHashMap < mir:: Local , FxHashSet < BorrowIndex > > ,
189
182
190
183
/// When we encounter a 2-phase borrow statement, it will always
@@ -229,7 +222,6 @@ impl<'a, 'gcx, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'gcx, 'tcx> {
229
222
230
223
self . insert_as_pending_if_two_phase ( location, & assigned_place, kind, idx) ;
231
224
232
- self . region_map . entry ( region) . or_default ( ) . insert ( idx) ;
233
225
if let Some ( local) = borrowed_place. root_local ( ) {
234
226
self . local_map . entry ( local) . or_default ( ) . insert ( idx) ;
235
227
}
0 commit comments