diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index 397cf1680e0a..e2d696e9b0f7 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -11,11 +11,12 @@ //! This query borrow-checks the MIR to (further) ensure it is not broken. use borrow_check::nll::region_infer::RegionInferenceContext; +use borrow_check::location::LocationIndex; use rustc::hir; use rustc::hir::def_id::DefId; use rustc::hir::map::definitions::DefPathData; use rustc::infer::InferCtxt; -use rustc::ty::{self, ParamEnv, TyCtxt}; +use rustc::ty::{self, ParamEnv, RegionVid, TyCtxt}; use rustc::ty::maps::Providers; use rustc::lint::builtin::UNUSED_MUT; use rustc::mir::{AggregateKind, BasicBlock, BorrowCheckResult, BorrowKind}; @@ -45,6 +46,7 @@ use dataflow::move_paths::{IllegalMoveOriginKind, MoveError}; use dataflow::move_paths::{HasMoveData, LookupResult, MoveData, MovePathIndex}; use util::borrowck_errors::{BorrowckErrors, Origin}; use util::collect_writes::FindAssignments; +use polonius_engine::Output; use self::borrow_set::{BorrowSet, BorrowData}; use self::flows::Flows; @@ -198,7 +200,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>( let borrow_set = Rc::new(BorrowSet::build(tcx, mir)); // If we are in non-lexical mode, compute the non-lexical lifetimes. - let (regioncx, _polonius_output, opt_closure_req) = nll::compute_regions( + let (regioncx, polonius_output, opt_closure_req) = nll::compute_regions( infcx, def_id, free_regions, @@ -251,6 +253,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>( used_mut_upvars: SmallVec::new(), borrow_set, dominators, + polonius_output, }; let mut state = Flows::new( @@ -373,6 +376,9 @@ pub struct MirBorrowckCtxt<'cx, 'gcx: 'tcx, 'tcx: 'cx> { /// Dominators for MIR dominators: Dominators, + + /// Polonius Output + polonius_output: Option>>, } // Check that: