Skip to main content

Module visitors

Module visitors 

Source

Re-exportsΒ§

use crate::get_enclosing_block; πŸ”’
use crate::msrvs::Msrv; πŸ”’
use crate::qualify_min_const_fn::is_stable_const_fn_at; πŸ”’
use crate::res::MaybeResPath as _; πŸ”’
use crate::ty::needs_ordered_drop; πŸ”’
use core::ops::ControlFlow; πŸ”’
use rustc_ast::visit::VisitorResult as _; πŸ”’
use rustc_ast::visit::try_visit; πŸ”’
use rustc_hir::def::CtorKind; πŸ”’
use rustc_hir::def::DefKind; πŸ”’
use rustc_hir::def::Res; πŸ”’
use rustc_hir::intravisit; πŸ”’
use rustc_hir::intravisit::Visitor; πŸ”’
use rustc_hir::intravisit::walk_block; πŸ”’
use rustc_hir::intravisit::walk_expr; πŸ”’
use rustc_hir::intravisit::walk_qpath; πŸ”’
use rustc_hir as hir; πŸ”’
use rustc_hir::AmbigArg; πŸ”’
use rustc_hir::AnonConst; πŸ”’
use rustc_hir::Arm; πŸ”’
use rustc_hir::Block; πŸ”’
use rustc_hir::BlockCheckMode; πŸ”’
use rustc_hir::Body; πŸ”’
use rustc_hir::BodyId; πŸ”’
use rustc_hir::CRATE_HIR_ID; πŸ”’
use rustc_hir::ConstBlock; πŸ”’
use rustc_hir::Expr; πŸ”’
use rustc_hir::ExprKind; πŸ”’
use rustc_hir::HirId; πŸ”’
use rustc_hir::ItemId; πŸ”’
use rustc_hir::ItemKind; πŸ”’
use rustc_hir::LetExpr; πŸ”’
use rustc_hir::Pat; πŸ”’
use rustc_hir::QPath; πŸ”’
use rustc_hir::Stmt; πŸ”’
use rustc_hir::StructTailExpr; πŸ”’
use rustc_hir::UnOp; πŸ”’
use rustc_hir::UnsafeSource; πŸ”’
use rustc_lint::LateContext; πŸ”’
use rustc_middle::hir::nested_filter; πŸ”’
use rustc_middle::ty::adjustment::Adjust; πŸ”’
use rustc_middle::ty; πŸ”’
use rustc_middle::ty::Ty; πŸ”’
use rustc_middle::ty::TyCtxt; πŸ”’
use rustc_middle::ty::TypeckResults; πŸ”’
use rustc_span::Span; πŸ”’
use internal::Continue; πŸ”’

ModulesΒ§

internal πŸ”’

MacrosΒ§

visitable_ref πŸ”’

EnumsΒ§

Descend
Allows for controlled descent when using visitor functions. Use () instead when always descending into child nodes.

TraitsΒ§

Visitable
A type which can be visited.

FunctionsΒ§

any_temporaries_need_ordered_drop
Checks whether the drop order matters for any unconsumed temporary created by the given expression.
contains_break_or_continue
Checks whether the given expression contains any break or continue expressions. This does not enter any bodies or nested items, because a break or continue would not apply to the expression’s scope.
contains_try πŸ”’
returns true if expr contains match expr desugared from try
contains_unsafe_block
Checks if the given expression contains an unsafe block
find_all_ret_expressions
calls callback on every expression that could be the return value of expr.
for_each_expr
Calls the given function once for each expression contained. This will enter bodies, but not nested items.
for_each_expr_without_closures
Calls the given function once for each expression contained. This does not enter any bodies or nested items.
for_each_local_assignment
Runs the given function for each path expression referencing the given local which occur after the given expression.
for_each_local_use_after_expr
Runs the given function for each path expression referencing the given local which occur after the given expression.
for_each_unconsumed_temporary
for_each_value_source
Runs the given function for each sub-expression producing the final value consumed by the parent of the give expression.
is_const_evaluatable
Checks if the given expression can be evaluated as a constant at the specified node
is_const_evaluatable_helper πŸ”’
Returns whether the given expression can be evaluated as a constant assuming that all its sub expressions can be evaluated as constants.
is_const_param_evaluatable
Checks if the given expression can be used as a const parameter.
is_expr_unsafe
Checks if the given expression performs an unsafe operation outside of an unsafe block.
is_local_used
Checks if the given local is used.
is_res_used
Checks if the given resolved path is used in the given body.
local_used_once
If the local is only used once in visitable returns the path expression referencing the given local