@@ -425,8 +425,8 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
425
425
426
426
/// Remove `local` from the pool of `Locals`. Allows writing to them,
427
427
/// but not reading from them anymore.
428
- fn remove_const ( & mut self , local : Local ) {
429
- self . ecx . frame_mut ( ) . locals [ local] =
428
+ fn remove_const ( ecx : & mut InterpCx < ' mir , ' tcx , ConstPropMachine < ' mir , ' tcx > > , local : Local ) {
429
+ ecx. frame_mut ( ) . locals [ local] =
430
430
LocalState { value : LocalValue :: Uninitialized , layout : Cell :: new ( None ) } ;
431
431
}
432
432
@@ -913,7 +913,7 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
913
913
{
914
914
trace ! ( "can't propagate into {:?}" , local) ;
915
915
if local != RETURN_PLACE {
916
- self . remove_const ( local) ;
916
+ Self :: remove_const ( & mut self . ecx , local) ;
917
917
}
918
918
}
919
919
}
@@ -952,7 +952,7 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
952
952
// doesn't use the invalid value
953
953
match cond {
954
954
Operand :: Move ( ref place) | Operand :: Copy ( ref place) => {
955
- self . remove_const ( place. local ) ;
955
+ Self :: remove_const ( & mut self . ecx , place. local ) ;
956
956
}
957
957
Operand :: Constant ( _) => { }
958
958
}
@@ -1064,7 +1064,7 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
1064
1064
"removing local {:?} from const-prop, since it's restricted to just its own block." ,
1065
1065
local
1066
1066
) ;
1067
- self . remove_const ( local) ;
1067
+ Self :: remove_const ( & mut self . ecx , local) ;
1068
1068
}
1069
1069
// Before moving on to the next block, we must forget all restricted locals, because we
1070
1070
// have already removed them from the `const` pool
0 commit comments