@@ -16,7 +16,7 @@ use rustc::mir::traversal;
1616use rustc:: mir:: visit:: {
1717 PlaceContext , Visitor , NonUseContext , MutatingUseContext , NonMutatingUseContext
1818} ;
19- use rustc:: mir:: { self , Location , Mir , Place , Local } ;
19+ use rustc:: mir:: { self , Location , Mir , Local } ;
2020use rustc:: ty:: { RegionVid , TyCtxt } ;
2121use rustc:: util:: nodemap:: { FxHashMap , FxHashSet } ;
2222use rustc_data_structures:: indexed_vec:: IndexVec ;
@@ -41,10 +41,6 @@ crate struct BorrowSet<'tcx> {
4141 /// only need to store one borrow index
4242 crate activation_map : FxHashMap < Location , Vec < BorrowIndex > > ,
4343
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-
4844 /// Map from local to all the borrows on that local
4945 crate local_map : FxHashMap < mir:: Local , FxHashSet < BorrowIndex > > ,
5046
@@ -149,7 +145,6 @@ impl<'tcx> BorrowSet<'tcx> {
149145 idx_vec : IndexVec :: new ( ) ,
150146 location_map : Default :: default ( ) ,
151147 activation_map : Default :: default ( ) ,
152- region_map : Default :: default ( ) ,
153148 local_map : Default :: default ( ) ,
154149 pending_activations : Default :: default ( ) ,
155150 locals_state_at_exit :
@@ -164,7 +159,6 @@ impl<'tcx> BorrowSet<'tcx> {
164159 borrows : visitor. idx_vec ,
165160 location_map : visitor. location_map ,
166161 activation_map : visitor. activation_map ,
167- region_map : visitor. region_map ,
168162 local_map : visitor. local_map ,
169163 locals_state_at_exit : visitor. locals_state_at_exit ,
170164 }
@@ -184,7 +178,6 @@ struct GatherBorrows<'a, 'gcx: 'tcx, 'tcx: 'a> {
184178 idx_vec : IndexVec < BorrowIndex , BorrowData < ' tcx > > ,
185179 location_map : FxHashMap < Location , BorrowIndex > ,
186180 activation_map : FxHashMap < Location , Vec < BorrowIndex > > ,
187- region_map : FxHashMap < RegionVid , FxHashSet < BorrowIndex > > ,
188181 local_map : FxHashMap < mir:: Local , FxHashSet < BorrowIndex > > ,
189182
190183 /// 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> {
229222
230223 self . insert_as_pending_if_two_phase ( location, & assigned_place, kind, idx) ;
231224
232- self . region_map . entry ( region) . or_default ( ) . insert ( idx) ;
233225 if let Some ( local) = borrowed_place. root_local ( ) {
234226 self . local_map . entry ( local) . or_default ( ) . insert ( idx) ;
235227 }
0 commit comments