File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -163,18 +163,15 @@ fn compute_replacement<'tcx>(
163163 } ;
164164
165165 let mut can_perform_opt = |target : Place < ' tcx > , loc : Location | {
166- maybe_dead. seek_after_primary_effect ( loc) ;
167- let maybe_dead = maybe_dead. contains ( target. local ) ;
168-
169166 if target. projection . first ( ) == Some ( & PlaceElem :: Deref ) {
170167 // We are creating a reborrow. As `place.local` is a reference, removing the storage
171168 // statements should not make it much harder for LLVM to optimize.
172- if maybe_dead {
173- storage_to_remove. insert ( target. local ) ;
174- }
169+ storage_to_remove. insert ( target. local ) ;
175170 true
176171 } else {
177172 // This is a proper dereference. We can only allow it if `target` is live.
173+ maybe_dead. seek_after_primary_effect ( loc) ;
174+ let maybe_dead = maybe_dead. contains ( target. local ) ;
178175 !maybe_dead
179176 }
180177 } ;
You can’t perform that action at this time.
0 commit comments