File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 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> {
374374 }
375375
376376 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-
381377 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 ;
391389 }
392390
393- break ;
391+ * place = target. project_deeper ( & place. projection [ 1 ..] , self . tcx ) ;
392+ self . any_replacement = true ;
394393 }
395394 }
396395
You can’t perform that action at this time.
0 commit comments