From 840594115dd6a992b45090ff986f8257503ee8a0 Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Wed, 21 Sep 2016 23:16:31 -0600 Subject: [PATCH] Update for changes in rustc. --- src/interpreter/step.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/interpreter/step.rs b/src/interpreter/step.rs index 6f8a297a6d8f..f87f5e43a960 100644 --- a/src/interpreter/step.rs +++ b/src/interpreter/step.rs @@ -82,6 +82,10 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> { // Miri can safely ignore these. Only translation needs them. StorageLive(_) | StorageDead(_) => {} + + // Defined to do nothing. These are added by optimization passes, to avoid changing the + // size of MIR constantly. + Nop => {} } self.frame_mut().stmt += 1; @@ -186,12 +190,18 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for ConstantExtractor<'a, 'b, 'tcx> { } } - fn visit_lvalue(&mut self, lvalue: &mir::Lvalue<'tcx>, context: LvalueContext, location: mir::Location) { + fn visit_lvalue( + &mut self, + lvalue: &mir::Lvalue<'tcx>, + context: LvalueContext<'tcx>, + location: mir::Location + ) { self.super_lvalue(lvalue, context, location); if let mir::Lvalue::Static(def_id) = *lvalue { let substs = subst::Substs::empty(self.ecx.tcx); let span = self.span; - if let hir::map::Node::NodeItem(&hir::Item { ref node, .. }) = self.ecx.tcx.map.get_if_local(def_id).expect("static not found") { + let node_item = self.ecx.tcx.map.get_if_local(def_id).expect("static not found"); + if let hir::map::Node::NodeItem(&hir::Item { ref node, .. }) = node_item { if let hir::ItemStatic(_, m, _) = *node { self.global_item(def_id, substs, span, m == hir::MutImmutable); return;