about summary refs log tree commit diff
path: root/src/librustc_mir/dataflow/impls
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2017-10-30 04:51:10 -0400
committerNiko Matsakis <niko@alum.mit.edu>2017-11-02 04:40:50 -0400
commitcafbd99c3822f24ca53c3cce79ffe2471e05dbc3 (patch)
tree799402bab481bff6136b465702fbe9003f825ee8 /src/librustc_mir/dataflow/impls
parent7b30e8d6681b10d6b7ecf92aa52d3085c5218a85 (diff)
downloadrust-cafbd99c3822f24ca53c3cce79ffe2471e05dbc3.tar.gz
rust-cafbd99c3822f24ca53c3cce79ffe2471e05dbc3.zip
extend NLL regions to include free region indices and add outlives
Diffstat (limited to 'src/librustc_mir/dataflow/impls')
-rw-r--r--src/librustc_mir/dataflow/impls/borrows.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs
index 17aa8c05418..85f05a10cd9 100644
--- a/src/librustc_mir/dataflow/impls/borrows.rs
+++ b/src/librustc_mir/dataflow/impls/borrows.rs
@@ -38,7 +38,7 @@ pub struct Borrows<'a, 'gcx: 'tcx, 'tcx: 'a> {
     location_map: FxHashMap<Location, BorrowIndex>,
     region_map: FxHashMap<Region<'tcx>, FxHashSet<BorrowIndex>>,
     region_span_map: FxHashMap<RegionKind, Span>,
-    nonlexical_regioncx: Option<&'a RegionInferenceContext>,
+    nonlexical_regioncx: Option<&'a RegionInferenceContext<'tcx>>,
 }
 
 // temporarily allow some dead fields: `kind` and `region` will be
@@ -69,7 +69,7 @@ impl<'tcx> fmt::Display for BorrowData<'tcx> {
 impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
     pub fn new(tcx: TyCtxt<'a, 'gcx, 'tcx>,
                mir: &'a Mir<'tcx>,
-               nonlexical_regioncx: Option<&'a RegionInferenceContext>)
+               nonlexical_regioncx: Option<&'a RegionInferenceContext<'tcx>>)
                -> Self {
         let mut visitor = GatherBorrows { idx_vec: IndexVec::new(),
                                           location_map: FxHashMap(),
@@ -140,7 +140,7 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
         if let Some(regioncx) = self.nonlexical_regioncx {
             for (borrow_index, borrow_data) in self.borrows.iter_enumerated() {
                 let borrow_region = regioncx.region_value(borrow_data.region.to_region_index());
-                if !borrow_region.may_contain(location) && location != borrow_data.location {
+                if !borrow_region.may_contain_point(location) && location != borrow_data.location {
                     debug!("kill_loans_out_of_scope_at_location: kill{:?} \
                            location={:?} borrow_data={:?}", borrow_index, location, borrow_data);
                     sets.kill(&borrow_index);