Skip to content

Commit 8405941

Browse files
committed
Update for changes in rustc.
1 parent 89b9b35 commit 8405941

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/interpreter/step.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
8282

8383
// Miri can safely ignore these. Only translation needs them.
8484
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 => {}
8589
}
8690

8791
self.frame_mut().stmt += 1;
@@ -186,12 +190,18 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for ConstantExtractor<'a, 'b, 'tcx> {
186190
}
187191
}
188192

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+
) {
190199
self.super_lvalue(lvalue, context, location);
191200
if let mir::Lvalue::Static(def_id) = *lvalue {
192201
let substs = subst::Substs::empty(self.ecx.tcx);
193202
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 {
195205
if let hir::ItemStatic(_, m, _) = *node {
196206
self.global_item(def_id, substs, span, m == hir::MutImmutable);
197207
return;

0 commit comments

Comments
 (0)