Skip to content

Commit cc4d1e5

Browse files
committed
Stop marking locals as dead in ConstProp.
1 parent 70e04bd commit cc4d1e5

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

compiler/rustc_mir_transform/src/const_prop.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -886,13 +886,7 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> {
886886
}
887887
}
888888
StatementKind::StorageLive(local) => {
889-
let frame = self.ecx.frame_mut();
890-
frame.locals[local].value =
891-
LocalValue::Live(interpret::Operand::Immediate(interpret::Immediate::Uninit));
892-
}
893-
StatementKind::StorageDead(local) => {
894-
let frame = self.ecx.frame_mut();
895-
frame.locals[local].value = LocalValue::Dead;
889+
Self::remove_const(&mut self.ecx, local);
896890
}
897891
_ => {}
898892
}

0 commit comments

Comments
 (0)