Expand description
This file builds up the ScopeTree, which describes
the parent links in the region hierarchy.
For more information about how MIR-based region-checking works, see the rustc dev guide.
Re-exportsΒ§
use std::mem;πuse rustc_data_structures::fx::FxHashMap;πuse rustc_hir as hir;πuse rustc_hir::def::CtorKind;πuse rustc_hir::def::DefKind;πuse rustc_hir::def::Res;πuse rustc_hir::def_id::LocalDefId;πuse rustc_hir::intravisit;πuse rustc_hir::intravisit::Visitor;πuse rustc_hir::Arm;πuse rustc_hir::Block;πuse rustc_hir::Expr;πuse rustc_hir::LetStmt;πuse rustc_hir::Pat;πuse rustc_hir::PatKind;πuse rustc_hir::Stmt;πuse rustc_index::Idx;πuse rustc_lint_defs::LintId;πuse rustc_lint_defs::builtin::TAIL_EXPR_DROP_ORDER;πuse rustc_middle::ty::TyCtxt;πuse rustc_span::Spanned;πuse tracing::debug;πuse rustc_middle::middle::region::*;π
StructsΒ§
- Context π
- Scope
Resolution πVisitor
EnumsΒ§
- LetKind π
FunctionsΒ§
- record_
subexpr_ πextended_ temp_ scopes - Applied to an expression
exprifexprβ or something owned or partially owned byexprβ is going to be indirectly referenced by a variable in a let statement. In that case, the βtemporary lifetimeβ ofexpris extended to be the block enclosing theletstatement. - record_
var_ πlifetime - Records the lifetime of a local variable as
cx.var_parent - region_
scope_ πtree - Per-body
region::ScopeTree. TheDefIdshould be the ownerDefIdfor the body; in the case of closures, this will be redirected to the enclosing function. - resolve_
arm π - resolve_
block π - resolve_
cond π - Resolve a condition from an
ifexpression or match guard so that it is a terminating scope if it doesnβt containletexpressions. - resolve_
expr π - resolve_
local π - resolve_
pat π - resolve_
stmt π