@@ -82,6 +82,10 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
82
82
83
83
// Miri can safely ignore these. Only translation needs them.
84
84
StorageLive ( _) | StorageDead ( _) => { }
85
+
86
+ // Defined to do nothing. These are added by optimization passes, to avoid changing the
87
+ // size of MIR constantly.
88
+ Nop => { }
85
89
}
86
90
87
91
self . frame_mut ( ) . stmt += 1 ;
@@ -186,12 +190,18 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for ConstantExtractor<'a, 'b, 'tcx> {
186
190
}
187
191
}
188
192
189
- fn visit_lvalue ( & mut self , lvalue : & mir:: Lvalue < ' tcx > , context : LvalueContext , location : mir:: Location ) {
193
+ fn visit_lvalue (
194
+ & mut self ,
195
+ lvalue : & mir:: Lvalue < ' tcx > ,
196
+ context : LvalueContext < ' tcx > ,
197
+ location : mir:: Location
198
+ ) {
190
199
self . super_lvalue ( lvalue, context, location) ;
191
200
if let mir:: Lvalue :: Static ( def_id) = * lvalue {
192
201
let substs = subst:: Substs :: empty ( self . ecx . tcx ) ;
193
202
let span = self . span ;
194
- if let hir:: map:: Node :: NodeItem ( & hir:: Item { ref node, .. } ) = self . ecx . tcx . map . get_if_local ( def_id) . expect ( "static not found" ) {
203
+ let node_item = self . ecx . tcx . map . get_if_local ( def_id) . expect ( "static not found" ) ;
204
+ if let hir:: map:: Node :: NodeItem ( & hir:: Item { ref node, .. } ) = node_item {
195
205
if let hir:: ItemStatic ( _, m, _) = * node {
196
206
self . global_item ( def_id, substs, span, m == hir:: MutImmutable ) ;
197
207
return ;
0 commit comments