|
11 | 11 | //! This query borrow-checks the MIR to (further) ensure it is not broken.
|
12 | 12 |
|
13 | 13 | use borrow_check::nll::region_infer::RegionInferenceContext;
|
| 14 | +use borrow_check::location::LocationIndex; |
14 | 15 | use rustc::hir;
|
15 | 16 | use rustc::hir::def_id::DefId;
|
16 | 17 | use rustc::hir::map::definitions::DefPathData;
|
17 | 18 | use rustc::infer::InferCtxt;
|
18 |
| -use rustc::ty::{self, ParamEnv, TyCtxt}; |
| 19 | +use rustc::ty::{self, ParamEnv, RegionVid, TyCtxt}; |
19 | 20 | use rustc::ty::maps::Providers;
|
20 | 21 | use rustc::lint::builtin::UNUSED_MUT;
|
21 | 22 | use rustc::mir::{AggregateKind, BasicBlock, BorrowCheckResult, BorrowKind};
|
@@ -45,6 +46,7 @@ use dataflow::move_paths::{IllegalMoveOriginKind, MoveError};
|
45 | 46 | use dataflow::move_paths::{HasMoveData, LookupResult, MoveData, MovePathIndex};
|
46 | 47 | use util::borrowck_errors::{BorrowckErrors, Origin};
|
47 | 48 | use util::collect_writes::FindAssignments;
|
| 49 | +use polonius_engine::Output; |
48 | 50 |
|
49 | 51 | use self::borrow_set::{BorrowSet, BorrowData};
|
50 | 52 | use self::flows::Flows;
|
@@ -198,7 +200,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
|
198 | 200 | let borrow_set = Rc::new(BorrowSet::build(tcx, mir));
|
199 | 201 |
|
200 | 202 | // 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( |
202 | 204 | infcx,
|
203 | 205 | def_id,
|
204 | 206 | free_regions,
|
@@ -251,6 +253,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
|
251 | 253 | used_mut_upvars: SmallVec::new(),
|
252 | 254 | borrow_set,
|
253 | 255 | dominators,
|
| 256 | + polonius_output, |
254 | 257 | };
|
255 | 258 |
|
256 | 259 | let mut state = Flows::new(
|
@@ -373,6 +376,9 @@ pub struct MirBorrowckCtxt<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
|
373 | 376 |
|
374 | 377 | /// Dominators for MIR
|
375 | 378 | dominators: Dominators<BasicBlock>,
|
| 379 | + |
| 380 | + /// Polonius Output |
| 381 | + polonius_output: Option<Rc<Output<RegionVid, BorrowIndex, LocationIndex>>>, |
376 | 382 | }
|
377 | 383 |
|
378 | 384 | // Check that:
|
|
0 commit comments