Skip to main content Module visitors Copy item path Source 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 ; π internal π visitable_ref π Descend Allows for controlled descent when using visitor functions. Use () instead when always
descending into child nodes. Visitable A type which can be visited. 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