Remove closure_tree
This commit is contained in:
parent
41f0e13bc5
commit
98a11e01e5
2 changed files with 1 additions and 45 deletions
|
@ -23,14 +23,6 @@ use std::mem;
|
|||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct Context {
|
||||
/// The root of the current region tree. This is typically the id
|
||||
/// of the innermost fn body. Each fn forms its own disjoint tree
|
||||
/// in the region hierarchy. These fn bodies are themselves
|
||||
/// arranged into a tree. See the "Modeling closures" section of
|
||||
/// the README in `rustc_trait_selection::infer::region_constraints`
|
||||
/// for more details.
|
||||
root_id: Option<hir::ItemLocalId>,
|
||||
|
||||
/// The scope that contains any new variables declared, plus its depth in
|
||||
/// the scope tree.
|
||||
var_parent: Option<(Scope, ScopeDepth)>,
|
||||
|
@ -743,11 +735,6 @@ impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
|
|||
let outer_pessimistic_yield = mem::replace(&mut self.pessimistic_yield, false);
|
||||
self.terminating_scopes.insert(body.value.hir_id.local_id);
|
||||
|
||||
if let Some(root_id) = self.cx.root_id {
|
||||
self.scope_tree.record_closure_parent(body.value.hir_id.local_id, root_id);
|
||||
}
|
||||
self.cx.root_id = Some(body.value.hir_id.local_id);
|
||||
|
||||
self.enter_scope(Scope { id: body.value.hir_id.local_id, data: ScopeData::CallSite });
|
||||
self.enter_scope(Scope { id: body.value.hir_id.local_id, data: ScopeData::Arguments });
|
||||
|
||||
|
@ -824,7 +811,7 @@ fn region_scope_tree(tcx: TyCtxt<'_>, def_id: DefId) -> &ScopeTree {
|
|||
tcx,
|
||||
scope_tree: ScopeTree::default(),
|
||||
expr_and_pat_count: 0,
|
||||
cx: Context { root_id: None, parent: None, var_parent: None },
|
||||
cx: Context { parent: None, var_parent: None },
|
||||
terminating_scopes: Default::default(),
|
||||
pessimistic_yield: false,
|
||||
fixup_scopes: vec![],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue