]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/borrow_check/nll/invalidation.rs
moving some variants from InterpError to EvalErrorPanic
[rust.git] / src / librustc_mir / borrow_check / nll / invalidation.rs
index 286f3ac5ccdad87c379a75ca3072e4c64a02d707..51a00d2f0eb6416a3d9cf4f1d01bd15f6be296ff 100644 (file)
@@ -11,7 +11,7 @@
 use crate::dataflow::indexes::BorrowIndex;
 use rustc::ty::TyCtxt;
 use rustc::mir::visit::Visitor;
-use rustc::mir::{BasicBlock, Location, Body, Place, PlaceBase, Rvalue};
+use rustc::mir::{BasicBlock, Location, Body, Place, Rvalue};
 use rustc::mir::{Statement, StatementKind};
 use rustc::mir::TerminatorKind;
 use rustc::mir::{Operand, BorrowKind};
@@ -43,7 +43,7 @@ pub(super) fn generate_invalidates<'tcx>(
     }
 }
 
-struct InvalidationGenerator<'cx, 'tcx: 'cx> {
+struct InvalidationGenerator<'cx, 'tcx> {
     tcx: TyCtxt<'tcx>,
     all_facts: &'cx mut AllFacts,
     location_table: &'cx LocationTable,
@@ -124,7 +124,7 @@ fn visit_statement(
             StatementKind::StorageDead(local) => {
                 self.access_place(
                     location,
-                    &Place::Base(PlaceBase::Local(local)),
+                    &Place::from(local),
                     (Shallow(None), Write(WriteKind::StorageDeadOrDrop)),
                     LocalMutationIsAllowed::Yes,
                 );
@@ -207,8 +207,8 @@ fn visit_terminator_kind(
                 cleanup: _,
             } => {
                 self.consume_operand(location, cond);
-                use rustc::mir::interpret::InterpError::BoundsCheck;
-                if let BoundsCheck { ref len, ref index } = *msg {
+                use rustc::mir::interpret::{InterpError::Panic, EvalErrorPanic::BoundsCheck};
+                if let Panic(BoundsCheck { ref len, ref index }) = *msg {
                     self.consume_operand(location, len);
                     self.consume_operand(location, index);
                 }