File tree 1 file changed +13
-14
lines changed
compiler/rustc_mir_transform/src
1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -374,23 +374,22 @@ impl<'tcx> MutVisitor<'tcx> for Replacer<'tcx> {
374
374
}
375
375
376
376
fn visit_place ( & mut self , place : & mut Place < ' tcx > , ctxt : PlaceContext , loc : Location ) {
377
- if place. projection . first ( ) != Some ( & PlaceElem :: Deref ) {
378
- return ;
379
- }
380
-
381
377
loop {
382
- if let Value :: Pointer ( target, _) = self . targets [ place. local ] {
383
- let perform_opt = matches ! ( ctxt, PlaceContext :: NonUse ( _) )
384
- || self . allowed_replacements . contains ( & ( target. local , loc) ) ;
385
-
386
- if perform_opt {
387
- * place = target. project_deeper ( & place. projection [ 1 ..] , self . tcx ) ;
388
- self . any_replacement = true ;
389
- continue ;
390
- }
378
+ if place. projection . first ( ) != Some ( & PlaceElem :: Deref ) {
379
+ return ;
380
+ }
381
+
382
+ let Value :: Pointer ( target, _) = self . targets [ place. local ] else { return } ;
383
+
384
+ let perform_opt = matches ! ( ctxt, PlaceContext :: NonUse ( _) )
385
+ || self . allowed_replacements . contains ( & ( target. local , loc) ) ;
386
+
387
+ if !perform_opt {
388
+ return ;
391
389
}
392
390
393
- break ;
391
+ * place = target. project_deeper ( & place. projection [ 1 ..] , self . tcx ) ;
392
+ self . any_replacement = true ;
394
393
}
395
394
}
396
395
You can’t perform that action at this time.
0 commit comments