mirror of
https://github.com/openharmony/third_party_rust_rust.git
synced 2026-07-19 11:43:39 -04:00
Keep map hidden and instead move it out after visitor is finished
This commit is contained in:
@@ -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();
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user