Struct rustc::middle::expr_use_visitor::ExprUseVisitor [−][src]
pub struct ExprUseVisitor<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { mc: MemCategorizationContext<'a, 'gcx, 'tcx>, delegate: &'a mut Delegate<'tcx>, param_env: ParamEnv<'tcx>, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields
mc: MemCategorizationContext<'a, 'gcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
delegate: &'a mut Delegate<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
param_env: ParamEnv<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Methods
impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx, 'tcx>
[src]
impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx, 'tcx>
pub fn new(
delegate: &'a mut (Delegate<'tcx> + 'a),
tcx: TyCtxt<'a, 'tcx, 'tcx>,
param_env: ParamEnv<'tcx>,
region_scope_tree: &'a ScopeTree,
tables: &'a TypeckTables<'tcx>,
rvalue_promotable_map: Option<Lrc<ItemLocalSet>>
) -> Self
[src]
pub fn new(
delegate: &'a mut (Delegate<'tcx> + 'a),
tcx: TyCtxt<'a, 'tcx, 'tcx>,
param_env: ParamEnv<'tcx>,
region_scope_tree: &'a ScopeTree,
tables: &'a TypeckTables<'tcx>,
rvalue_promotable_map: Option<Lrc<ItemLocalSet>>
) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Creates the ExprUseVisitor, configuring it with the various options provided:
delegate
-- who receives the callbacksparam_env
--- parameter environment for trait lookups (esp. pertaining toCopy
)region_scope_tree
--- region scope tree for the code being analyzedtables
--- typeck results for the code being analyzedrvalue_promotable_map
--- if you care about rvalue promotion, then provide the map here (it can be computed withtcx.rvalue_promotable_map(def_id)
).None
means that rvalues will be given more conservative lifetimes.
See also with_infer
, which is used during typeck.
impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx>
pub fn with_infer(
delegate: &'a mut (Delegate<'tcx> + 'a),
infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
param_env: ParamEnv<'tcx>,
region_scope_tree: &'a ScopeTree,
tables: &'a TypeckTables<'tcx>
) -> Self
[src]
pub fn with_infer(
delegate: &'a mut (Delegate<'tcx> + 'a),
infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
param_env: ParamEnv<'tcx>,
region_scope_tree: &'a ScopeTree,
tables: &'a TypeckTables<'tcx>
) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn consume_body(&mut self, body: &Body)
[src]
pub fn consume_body(&mut self, body: &Body)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx>
[src]
fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn delegate_consume(
&mut self,
consume_id: NodeId,
consume_span: Span,
cmt: &cmt_<'tcx>
)
[src]
fn delegate_consume(
&mut self,
consume_id: NodeId,
consume_span: Span,
cmt: &cmt_<'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn consume_exprs(&mut self, exprs: &[Expr])
[src]
fn consume_exprs(&mut self, exprs: &[Expr])
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn consume_expr(&mut self, expr: &Expr)
[src]
pub fn consume_expr(&mut self, expr: &Expr)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn mutate_expr(&mut self, assignment_expr: &Expr, expr: &Expr, mode: MutateMode)
[src]
fn mutate_expr(&mut self, assignment_expr: &Expr, expr: &Expr, mode: MutateMode)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn borrow_expr(
&mut self,
expr: &Expr,
r: Region<'tcx>,
bk: BorrowKind,
cause: LoanCause
)
[src]
fn borrow_expr(
&mut self,
expr: &Expr,
r: Region<'tcx>,
bk: BorrowKind,
cause: LoanCause
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn select_from_expr(&mut self, expr: &Expr)
[src]
fn select_from_expr(&mut self, expr: &Expr)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn walk_expr(&mut self, expr: &Expr)
[src]
pub fn walk_expr(&mut self, expr: &Expr)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn walk_callee(&mut self, call: &Expr, callee: &Expr)
[src]
fn walk_callee(&mut self, call: &Expr, callee: &Expr)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn walk_stmt(&mut self, stmt: &Stmt)
[src]
fn walk_stmt(&mut self, stmt: &Stmt)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn walk_local(&mut self, local: &Local)
[src]
fn walk_local(&mut self, local: &Local)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn walk_block(&mut self, blk: &Block)
[src]
fn walk_block(&mut self, blk: &Block)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Indicates that the value of blk
will be consumed, meaning either copied or moved
depending on its type.
fn walk_struct_expr(&mut self, fields: &[Field], opt_with: &Option<P<Expr>>)
[src]
fn walk_struct_expr(&mut self, fields: &[Field], opt_with: &Option<P<Expr>>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn walk_adjustment(&mut self, expr: &Expr)
[src]
fn walk_adjustment(&mut self, expr: &Expr)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn walk_autoref(
&mut self,
expr: &Expr,
cmt_base: &cmt_<'tcx>,
autoref: &AutoBorrow<'tcx>
)
[src]
fn walk_autoref(
&mut self,
expr: &Expr,
cmt_base: &cmt_<'tcx>,
autoref: &AutoBorrow<'tcx>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Walks the autoref autoref
applied to the autoderef'd
expr
. cmt_base
is the mem-categorized form of expr
after all relevant autoderefs have occurred.
fn arm_move_mode(&mut self, discr_cmt: cmt<'tcx>, arm: &Arm) -> TrackMatchMode
[src]
fn arm_move_mode(&mut self, discr_cmt: cmt<'tcx>, arm: &Arm) -> TrackMatchMode
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn walk_arm(&mut self, discr_cmt: cmt<'tcx>, arm: &Arm, mode: MatchMode)
[src]
fn walk_arm(&mut self, discr_cmt: cmt<'tcx>, arm: &Arm, mode: MatchMode)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn walk_irrefutable_pat(&mut self, cmt_discr: cmt<'tcx>, pat: &Pat)
[src]
fn walk_irrefutable_pat(&mut self, cmt_discr: cmt<'tcx>, pat: &Pat)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Walks a pat that occurs in isolation (i.e. top-level of fn arg or let binding. Not a match arm or nested pat.)
fn determine_pat_move_mode(
&mut self,
cmt_discr: cmt<'tcx>,
pat: &Pat,
mode: &mut TrackMatchMode
)
[src]
fn determine_pat_move_mode(
&mut self,
cmt_discr: cmt<'tcx>,
pat: &Pat,
mode: &mut TrackMatchMode
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Identifies any bindings within pat
and accumulates within
mode
whether the overall pattern/match structure is a move,
copy, or borrow.
fn walk_pat(&mut self, cmt_discr: cmt<'tcx>, pat: &Pat, match_mode: MatchMode)
[src]
fn walk_pat(&mut self, cmt_discr: cmt<'tcx>, pat: &Pat, match_mode: MatchMode)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The core driver for walking a pattern; match_mode
must be
established up front, e.g. via determine_pat_move_mode
(see
also walk_irrefutable_pat
for patterns that stand alone).
fn walk_captures(&mut self, closure_expr: &Expr, fn_decl_span: Span)
[src]
fn walk_captures(&mut self, closure_expr: &Expr, fn_decl_span: Span)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn cat_captured_var(
&mut self,
closure_hir_id: HirId,
closure_span: Span,
upvar: &Freevar
) -> McResult<cmt_<'tcx>>
[src]
fn cat_captured_var(
&mut self,
closure_hir_id: HirId,
closure_span: Span,
upvar: &Freevar
) -> McResult<cmt_<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Auto Trait Implementations
impl<'a, 'gcx, 'tcx> !Send for ExprUseVisitor<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Send for ExprUseVisitor<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Sync for ExprUseVisitor<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Sync for ExprUseVisitor<'a, 'gcx, 'tcx>