diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2017-12-07 04:30:39 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2017-12-20 14:04:51 -0500 |
| commit | 741ef41e41e61ae107145d03ffcb263ffec5ca1f (patch) | |
| tree | ffbe334e4bd1e577c60039e2cede3abc5da68782 /src | |
| parent | 594c3865499533860c2d44ee5c01f7802d8e86bb (diff) | |
| download | rust-741ef41e41e61ae107145d03ffcb263ffec5ca1f.tar.gz rust-741ef41e41e61ae107145d03ffcb263ffec5ca1f.zip | |
use Rc to store nonlexical_regioncx in Borrows
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/borrow_check/mod.rs | 4 | ||||
| -rw-r--r-- | src/librustc_mir/dataflow/impls/borrows.rs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index 4dbb613f8fb..7df745bb2f4 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -25,6 +25,8 @@ use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::indexed_set::IdxSetBuf; use rustc_data_structures::indexed_vec::Idx; +use std::rc::Rc; + use syntax::ast; use syntax_pos::Span; @@ -202,7 +204,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>( &mut flow_inits, &mdpe.move_data, ); - (Some(regioncx), opt_closure_req) + (Some(Rc::new(regioncx)), opt_closure_req) } else { assert!(!tcx.sess.opts.debugging_opts.nll); (None, None) diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs index 2504aa5ff37..25e4b30da80 100644 --- a/src/librustc_mir/dataflow/impls/borrows.rs +++ b/src/librustc_mir/dataflow/impls/borrows.rs @@ -66,7 +66,7 @@ pub struct Borrows<'a, 'gcx: 'tcx, 'tcx: 'a> { region_map: FxHashMap<Region<'tcx>, FxHashSet<BorrowIndex>>, local_map: FxHashMap<mir::Local, FxHashSet<BorrowIndex>>, region_span_map: FxHashMap<RegionKind, Span>, - nonlexical_regioncx: Option<RegionInferenceContext<'tcx>>, + nonlexical_regioncx: Option<Rc<RegionInferenceContext<'tcx>>>, } // Two-phase borrows actually requires two flow analyses; they need @@ -147,7 +147,7 @@ impl ReserveOrActivateIndex { impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> { pub fn new(tcx: TyCtxt<'a, 'gcx, 'tcx>, mir: &'a Mir<'tcx>, - nonlexical_regioncx: Option<RegionInferenceContext<'tcx>>, + nonlexical_regioncx: Option<Rc<RegionInferenceContext<'tcx>>>, def_id: DefId, body_id: Option<hir::BodyId>) -> Self { |
