11//! Propagates constants for early reporting of statically known
22//! assertion failures
33
4- use std:: cell:: Cell ;
5-
64use either:: Right ;
75
86use rustc_const_eval:: const_eval:: CheckAlignment ;
@@ -25,8 +23,8 @@ use rustc_trait_selection::traits;
2523use crate :: MirPass ;
2624use rustc_const_eval:: interpret:: {
2725 self , compile_time_machine, AllocId , ConstAllocation , ConstValue , CtfeValidationMode , Frame ,
28- ImmTy , Immediate , InterpCx , InterpResult , LocalState , LocalValue , MemoryKind , OpTy , PlaceTy ,
29- Pointer , Scalar , StackPopCleanup , StackPopUnwind ,
26+ ImmTy , Immediate , InterpCx , InterpResult , LocalValue , MemoryKind , OpTy , PlaceTy , Pointer ,
27+ Scalar , StackPopCleanup , StackPopUnwind ,
3028} ;
3129
3230/// The maximum number of bytes that we'll allocate space for a local or the return value.
@@ -437,10 +435,8 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
437435 /// Remove `local` from the pool of `Locals`. Allows writing to them,
438436 /// but not reading from them anymore.
439437 fn remove_const ( ecx : & mut InterpCx < ' mir , ' tcx , ConstPropMachine < ' mir , ' tcx > > , local : Local ) {
440- ecx. frame_mut ( ) . locals [ local] = LocalState {
441- value : LocalValue :: Live ( interpret:: Operand :: Immediate ( interpret:: Immediate :: Uninit ) ) ,
442- layout : Cell :: new ( None ) ,
443- } ;
438+ ecx. frame_mut ( ) . locals [ local] . value =
439+ LocalValue :: Live ( interpret:: Operand :: Immediate ( interpret:: Immediate :: Uninit ) ) ;
444440 }
445441
446442 /// Returns the value, if any, of evaluating `c`.
0 commit comments