#[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)>,
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 });
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![],