@@ -5,7 +5,6 @@ use rustc_const_eval::interpret::{
5
5
self , compile_time_machine, AllocId , ConstAllocation , FnArg , Frame , ImmTy , InterpCx ,
6
6
InterpResult , OpTy , PlaceTy , Pointer ,
7
7
} ;
8
- use rustc_data_structures:: fx:: FxHashSet ;
9
8
use rustc_index:: bit_set:: BitSet ;
10
9
use rustc_index:: IndexVec ;
11
10
use rustc_middle:: mir:: visit:: { MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor } ;
@@ -49,24 +48,9 @@ pub(crate) macro throw_machine_stop_str($($tt:tt)*) {{
49
48
throw_machine_stop ! ( Zst )
50
49
} }
51
50
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 ;
68
52
69
- impl < ' mir , ' tcx > interpret:: Machine < ' mir , ' tcx > for ConstPropMachine < ' mir , ' tcx > {
53
+ impl < ' mir , ' tcx : ' mir > interpret:: Machine < ' mir , ' tcx > for ConstPropMachine {
70
54
compile_time_machine ! ( <' mir, ' tcx>) ;
71
55
72
56
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>
138
122
}
139
123
140
124
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 ,
144
128
) -> 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 ! ( )
158
130
}
159
131
160
132
fn before_access_global (
@@ -192,16 +164,16 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx>
192
164
193
165
#[ inline( always) ]
194
166
fn stack < ' a > (
195
- ecx : & ' a InterpCx < ' mir , ' tcx , Self > ,
167
+ _ecx : & ' a InterpCx < ' mir , ' tcx , Self > ,
196
168
) -> & ' a [ Frame < ' mir , ' tcx , Self :: Provenance , Self :: FrameExtra > ] {
197
- & ecx . machine . stack
169
+ & [ ]
198
170
}
199
171
200
172
#[ inline( always) ]
201
173
fn stack_mut < ' a > (
202
- ecx : & ' a mut InterpCx < ' mir , ' tcx , Self > ,
174
+ _ecx : & ' a mut InterpCx < ' mir , ' tcx , Self > ,
203
175
) -> & ' a mut Vec < Frame < ' mir , ' tcx , Self :: Provenance , Self :: FrameExtra > > {
204
- & mut ecx . machine . stack
176
+ unreachable ! ( )
205
177
}
206
178
}
207
179
0 commit comments