1
1
//! Propagates constants for early reporting of statically known
2
2
//! assertion failures
3
3
4
- use std:: cell:: Cell ;
5
-
6
4
use either:: Right ;
7
5
8
6
use rustc_const_eval:: const_eval:: CheckAlignment ;
@@ -25,8 +23,8 @@ use rustc_trait_selection::traits;
25
23
use crate :: MirPass ;
26
24
use rustc_const_eval:: interpret:: {
27
25
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 ,
30
28
} ;
31
29
32
30
/// 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> {
437
435
/// Remove `local` from the pool of `Locals`. Allows writing to them,
438
436
/// but not reading from them anymore.
439
437
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 ) ) ;
444
440
}
445
441
446
442
/// Returns the value, if any, of evaluating `c`.
0 commit comments