Skip to content

Commit 2cd09f2

Browse files
qmxspastorino
authored andcommitted
store polonius output in MirBorrowCtx
1 parent b45aebf commit 2cd09f2

File tree

1 file changed

+8
-2
lines changed
  • src/librustc_mir/borrow_check

1 file changed

+8
-2
lines changed

src/librustc_mir/borrow_check/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
//! This query borrow-checks the MIR to (further) ensure it is not broken.
1212
1313
use borrow_check::nll::region_infer::RegionInferenceContext;
14+
use borrow_check::location::LocationIndex;
1415
use rustc::hir;
1516
use rustc::hir::def_id::DefId;
1617
use rustc::hir::map::definitions::DefPathData;
1718
use rustc::infer::InferCtxt;
18-
use rustc::ty::{self, ParamEnv, TyCtxt};
19+
use rustc::ty::{self, ParamEnv, RegionVid, TyCtxt};
1920
use rustc::ty::maps::Providers;
2021
use rustc::lint::builtin::UNUSED_MUT;
2122
use rustc::mir::{AggregateKind, BasicBlock, BorrowCheckResult, BorrowKind};
@@ -45,6 +46,7 @@ use dataflow::move_paths::{IllegalMoveOriginKind, MoveError};
4546
use dataflow::move_paths::{HasMoveData, LookupResult, MoveData, MovePathIndex};
4647
use util::borrowck_errors::{BorrowckErrors, Origin};
4748
use util::collect_writes::FindAssignments;
49+
use polonius_engine::Output;
4850

4951
use self::borrow_set::{BorrowSet, BorrowData};
5052
use self::flows::Flows;
@@ -198,7 +200,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
198200
let borrow_set = Rc::new(BorrowSet::build(tcx, mir));
199201

200202
// If we are in non-lexical mode, compute the non-lexical lifetimes.
201-
let (regioncx, _polonius_output, opt_closure_req) = nll::compute_regions(
203+
let (regioncx, polonius_output, opt_closure_req) = nll::compute_regions(
202204
infcx,
203205
def_id,
204206
free_regions,
@@ -251,6 +253,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
251253
used_mut_upvars: SmallVec::new(),
252254
borrow_set,
253255
dominators,
256+
polonius_output,
254257
};
255258

256259
let mut state = Flows::new(
@@ -373,6 +376,9 @@ pub struct MirBorrowckCtxt<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
373376

374377
/// Dominators for MIR
375378
dominators: Dominators<BasicBlock>,
379+
380+
/// Polonius Output
381+
polonius_output: Option<Rc<Output<RegionVid, BorrowIndex, LocationIndex>>>,
376382
}
377383

378384
// Check that:

0 commit comments

Comments
 (0)