diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-04-22 18:14:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-22 18:14:32 +0200 |
| commit | 2f438e31f577bbb9367b9abbcbb5ce77ce54e979 (patch) | |
| tree | 3d6e13358dd6a850a644cd391f34af2e262465fe /compiler/rustc_passes | |
| parent | 25c15cdbe070f49d708f34750df2632e38bd4846 (diff) | |
| parent | c9c14d0c1f04f888fbd4ec8b254b61fff84db7d4 (diff) | |
| download | rust-2f438e31f577bbb9367b9abbcbb5ce77ce54e979.tar.gz rust-2f438e31f577bbb9367b9abbcbb5ce77ce54e979.zip | |
Rollup merge of #84343 - camsteffen:closure-tree, r=varkor
Remove `ScopeTree::closure_tree` Seems to be dead code since #50649.
Diffstat (limited to 'compiler/rustc_passes')
| -rw-r--r-- | compiler/rustc_passes/src/region.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/compiler/rustc_passes/src/region.rs b/compiler/rustc_passes/src/region.rs index b532021bed2..14a373c5942 100644 --- a/compiler/rustc_passes/src/region.rs +++ b/compiler/rustc_passes/src/region.rs @@ -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![], |
