Skip to content

Commit 0d29cd4

Browse files
committed
Keep map hidden and instead move it out after visitor is finished
1 parent 7193c68 commit 0d29cd4

File tree

1 file changed

+6
-1
lines changed
  • src/librustc_mir/transform

1 file changed

+6
-1
lines changed

src/librustc_mir/transform/nll.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::collections::HashMap;
2020

2121
#[allow(dead_code)]
2222
struct NLLVisitor<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
23-
pub lookup_map: HashMap<RegionVid, Lookup>,
23+
lookup_map: HashMap<RegionVid, Lookup>,
2424
infcx: InferCtxt<'a, 'gcx, 'tcx>,
2525
}
2626

@@ -32,6 +32,10 @@ impl<'a, 'gcx, 'tcx> NLLVisitor<'a, 'gcx, 'tcx> {
3232
}
3333
}
3434

35+
pub fn into_results(self) -> HashMap<RegionVid, Lookup> {
36+
self.lookup_map
37+
}
38+
3539
fn renumber_regions<T>(&self, value: &T) -> T where T: TypeFoldable<'tcx> {
3640
self.infcx.tcx.fold_regions(value, &mut false, |_region, _depth| {
3741
self.infcx.next_region_var(infer::MiscVariable(DUMMY_SP))
@@ -136,6 +140,7 @@ impl MirPass for NLL {
136140
let mut renumbered_mir = mir.clone();
137141
let mut visitor = NLLVisitor::new(infcx);
138142
visitor.visit_mir(&mut renumbered_mir);
143+
let _results = visitor.into_results();
139144
})
140145
}
141146
}

0 commit comments

Comments
 (0)