diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-03-22 19:07:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-22 19:07:34 +0100 |
| commit | 0e59ad4ce3e73abf7a099e33696e4d800e48df1a (patch) | |
| tree | 91c42ef9b93be692bce74251dcfdaf0914b3f406 /compiler/rustc_mir_transform/src | |
| parent | 7c380939517de8f3bddd2ed850a6dfdd6d8fcb49 (diff) | |
| parent | b92a60586a3f121592bded64a1556fae0f69c302 (diff) | |
Rollup merge of #95196 - RalfJung:unalloc-not-uninit, r=oli-obk
rename LocalState::Uninitialized to Unallocated This is to avoid confusion with `Uninit` as in `ScalarMaybeUninit`, which is very different. r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/const_prop.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_mir_transform/src/const_prop.rs b/compiler/rustc_mir_transform/src/const_prop.rs index 5ed33ab9fec..c4d15d4d187 100644 --- a/compiler/rustc_mir_transform/src/const_prop.rs +++ b/compiler/rustc_mir_transform/src/const_prop.rs @@ -244,8 +244,8 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx> ) -> InterpResult<'tcx, InterpOperand<Self::PointerTag>> { let l = &frame.locals[local]; - if l.value == LocalValue::Uninitialized { - throw_machine_stop_str!("tried to access an uninitialized local") + if l.value == LocalValue::Unallocated { + throw_machine_stop_str!("tried to access an unallocated local") } l.access() @@ -442,7 +442,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { /// but not reading from them anymore. fn remove_const(ecx: &mut InterpCx<'mir, 'tcx, ConstPropMachine<'mir, 'tcx>>, local: Local) { ecx.frame_mut().locals[local] = - LocalState { value: LocalValue::Uninitialized, layout: Cell::new(None) }; + LocalState { value: LocalValue::Unallocated, layout: Cell::new(None) }; } fn lint_root(&self, source_info: SourceInfo) -> Option<HirId> { @@ -1147,7 +1147,7 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> { let frame = self.ecx.frame_mut(); frame.locals[local].value = if let StatementKind::StorageLive(_) = statement.kind { - LocalValue::Uninitialized + LocalValue::Unallocated } else { LocalValue::Dead }; |
