@@ -5,7 +5,6 @@ use rustc_const_eval::interpret::{
55 self , compile_time_machine, AllocId , ConstAllocation , FnArg , Frame , ImmTy , InterpCx ,
66 InterpResult , OpTy , PlaceTy , Pointer ,
77} ;
8- use rustc_data_structures:: fx:: FxHashSet ;
98use rustc_index:: bit_set:: BitSet ;
109use rustc_index:: IndexVec ;
1110use rustc_middle:: mir:: visit:: { MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor } ;
@@ -49,24 +48,9 @@ pub(crate) macro throw_machine_stop_str($($tt:tt)*) {{
4948 throw_machine_stop ! ( Zst )
5049} }
5150
52- pub ( crate ) struct ConstPropMachine < ' mir , ' tcx > {
53- /// The virtual call stack.
54- stack : Vec < Frame < ' mir , ' tcx > > ,
55- pub written_only_inside_own_block_locals : FxHashSet < Local > ,
56- pub can_const_prop : IndexVec < Local , ConstPropMode > ,
57- }
58-
59- impl ConstPropMachine < ' _ , ' _ > {
60- pub fn new ( can_const_prop : IndexVec < Local , ConstPropMode > ) -> Self {
61- Self {
62- stack : Vec :: new ( ) ,
63- written_only_inside_own_block_locals : Default :: default ( ) ,
64- can_const_prop,
65- }
66- }
67- }
51+ pub ( crate ) struct ConstPropMachine ;
6852
69- impl < ' mir , ' tcx > interpret:: Machine < ' mir , ' tcx > for ConstPropMachine < ' mir , ' tcx > {
53+ impl < ' mir , ' tcx : ' mir > interpret:: Machine < ' mir , ' tcx > for ConstPropMachine {
7054 compile_time_machine ! ( <' mir, ' tcx>) ;
7155
7256 const PANIC_ON_ALLOC_FAIL : bool = true ; // all allocations are small (see `MAX_ALLOC_LIMIT`)
@@ -138,23 +122,11 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx>
138122 }
139123
140124 fn before_access_local_mut < ' a > (
141- ecx : & ' a mut InterpCx < ' mir , ' tcx , Self > ,
142- frame : usize ,
143- local : Local ,
125+ _ecx : & ' a mut InterpCx < ' mir , ' tcx , Self > ,
126+ _frame : usize ,
127+ _local : Local ,
144128 ) -> InterpResult < ' tcx > {
145- assert_eq ! ( frame, 0 ) ;
146- match ecx. machine . can_const_prop [ local] {
147- ConstPropMode :: NoPropagation => {
148- throw_machine_stop_str ! (
149- "tried to write to a local that is marked as not propagatable"
150- )
151- }
152- ConstPropMode :: OnlyInsideOwnBlock => {
153- ecx. machine . written_only_inside_own_block_locals . insert ( local) ;
154- }
155- ConstPropMode :: FullConstProp => { }
156- }
157- Ok ( ( ) )
129+ unreachable ! ( )
158130 }
159131
160132 fn before_access_global (
@@ -192,16 +164,16 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx>
192164
193165 #[ inline( always) ]
194166 fn stack < ' a > (
195- ecx : & ' a InterpCx < ' mir , ' tcx , Self > ,
167+ _ecx : & ' a InterpCx < ' mir , ' tcx , Self > ,
196168 ) -> & ' a [ Frame < ' mir , ' tcx , Self :: Provenance , Self :: FrameExtra > ] {
197- & ecx . machine . stack
169+ & [ ]
198170 }
199171
200172 #[ inline( always) ]
201173 fn stack_mut < ' a > (
202- ecx : & ' a mut InterpCx < ' mir , ' tcx , Self > ,
174+ _ecx : & ' a mut InterpCx < ' mir , ' tcx , Self > ,
203175 ) -> & ' a mut Vec < Frame < ' mir , ' tcx , Self :: Provenance , Self :: FrameExtra > > {
204- & mut ecx . machine . stack
176+ unreachable ! ( )
205177 }
206178}
207179
0 commit comments