Keep map hidden and instead move it out after visitor is finished
This commit is contained in:
parent
7193c68271
commit
0d29cd4c80
1 changed files with 6 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ use std::collections::HashMap;
|
|||
|
||||
#[allow(dead_code)]
|
||||
struct NLLVisitor<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
|
||||
pub lookup_map: HashMap<RegionVid, Lookup>,
|
||||
lookup_map: HashMap<RegionVid, Lookup>,
|
||||
infcx: InferCtxt<'a, 'gcx, 'tcx>,
|
||||
}
|
||||
|
||||
|
|
@ -32,6 +32,10 @@ impl<'a, 'gcx, 'tcx> NLLVisitor<'a, 'gcx, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn into_results(self) -> HashMap<RegionVid, Lookup> {
|
||||
self.lookup_map
|
||||
}
|
||||
|
||||
fn renumber_regions<T>(&self, value: &T) -> T where T: TypeFoldable<'tcx> {
|
||||
self.infcx.tcx.fold_regions(value, &mut false, |_region, _depth| {
|
||||
self.infcx.next_region_var(infer::MiscVariable(DUMMY_SP))
|
||||
|
|
@ -136,6 +140,7 @@ impl MirPass for NLL {
|
|||
let mut renumbered_mir = mir.clone();
|
||||
let mut visitor = NLLVisitor::new(infcx);
|
||||
visitor.visit_mir(&mut renumbered_mir);
|
||||
let _results = visitor.into_results();
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue