@@ -3,9 +3,7 @@ use crate::borrow_check::nll::ToRegionVid;
33use crate :: dataflow:: indexes:: BorrowIndex ;
44use crate :: dataflow:: move_paths:: MoveData ;
55use rustc:: mir:: traversal;
6- use rustc:: mir:: visit:: {
7- PlaceContext , Visitor , NonUseContext , MutatingUseContext , NonMutatingUseContext
8- } ;
6+ use rustc:: mir:: visit:: { PlaceContext , Visitor , NonUseContext , MutatingUseContext } ;
97use rustc:: mir:: { self , Location , Mir , Local } ;
108use rustc:: ty:: { RegionVid , TyCtxt } ;
119use rustc:: util:: nodemap:: { FxHashMap , FxHashSet } ;
@@ -257,31 +255,21 @@ impl<'a, 'gcx, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'gcx, 'tcx> {
257255 ) ;
258256 }
259257
260- // Otherwise, this is the unique later use
261- // that we expect.
262- borrow_data. activation_location = match context {
263- // The use of TMP in a shared borrow does not
264- // count as an actual activation.
265- PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: SharedBorrow ( ..) ) |
266- PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: ShallowBorrow ( ..) ) =>
267- TwoPhaseActivation :: NotActivated ,
268- _ => {
269- // Double check: This borrow is indeed a two-phase borrow (that is,
270- // we are 'transitioning' from `NotActivated` to `ActivatedAt`) and
271- // we've not found any other activations (checked above).
272- assert_eq ! (
273- borrow_data. activation_location,
274- TwoPhaseActivation :: NotActivated ,
275- "never found an activation for this borrow!" ,
276- ) ;
277-
278- self . activation_map
279- . entry ( location)
280- . or_default ( )
281- . push ( borrow_index) ;
282- TwoPhaseActivation :: ActivatedAt ( location)
283- }
284- } ;
258+ // Otherwise, this is the unique later use that we expect.
259+ // Double check: This borrow is indeed a two-phase borrow (that is,
260+ // we are 'transitioning' from `NotActivated` to `ActivatedAt`) and
261+ // we've not found any other activations (checked above).
262+ assert_eq ! (
263+ borrow_data. activation_location,
264+ TwoPhaseActivation :: NotActivated ,
265+ "never found an activation for this borrow!" ,
266+ ) ;
267+ self . activation_map
268+ . entry ( location)
269+ . or_default ( )
270+ . push ( borrow_index) ;
271+
272+ borrow_data. activation_location = TwoPhaseActivation :: ActivatedAt ( location) ;
285273 }
286274 }
287275
0 commit comments