Skip to main content

Module usage

Module usage 

Source

Re-exportsยง

use crate::macros::root_macro_call_first_node; ๐Ÿ”’
use crate::res::MaybeResPath as _; ๐Ÿ”’
use crate::visitors::Descend; ๐Ÿ”’
use crate::visitors::Visitable; ๐Ÿ”’
use crate::visitors::for_each_expr; ๐Ÿ”’
use crate::visitors::for_each_expr_without_closures; ๐Ÿ”’
use crate as utils; ๐Ÿ”’
use crate::get_enclosing_loop_or_multi_call_closure; ๐Ÿ”’
use crate::sym; ๐Ÿ”’
use core::ops::ControlFlow; ๐Ÿ”’
use hir::def::Res; ๐Ÿ”’
use rustc_hir::intravisit; ๐Ÿ”’
use rustc_hir::intravisit::Visitor; ๐Ÿ”’
use rustc_hir as hir; ๐Ÿ”’
use rustc_hir::Expr; ๐Ÿ”’
use rustc_hir::ExprKind; ๐Ÿ”’
use rustc_hir::HirId; ๐Ÿ”’
use rustc_hir::HirIdSet; ๐Ÿ”’
use rustc_hir_typeck::expr_use_visitor::Delegate; ๐Ÿ”’
use rustc_hir_typeck::expr_use_visitor::ExprUseVisitor; ๐Ÿ”’
use rustc_hir_typeck::expr_use_visitor::Place; ๐Ÿ”’
use rustc_hir_typeck::expr_use_visitor::PlaceBase; ๐Ÿ”’
use rustc_hir_typeck::expr_use_visitor::PlaceWithHirId; ๐Ÿ”’
use rustc_lint::LateContext; ๐Ÿ”’
use rustc_middle::hir::nested_filter; ๐Ÿ”’
use rustc_middle::mir::FakeReadCause; ๐Ÿ”’
use rustc_middle::ty; ๐Ÿ”’

Structsยง

BindingUsageFinder
A [Visitor] providing are_params_used(), which can be used to check parameter binding usage within a Body.
MutVarsDelegate ๐Ÿ”’
ParamBindingIdCollector
A [Visitor] that collects all HirIds bound by visited patterns.

Functionsยง

contains_return_break_continue_macro
Checks whether the given expression contains return, break, continue, or a macro call (which may itself contain any of those expressions).
contains_todo_unimplement_macro
Checks if the given expression contains macro call to todo!() or unimplemented!().
is_potentially_local_place
Checks whether it is possible that the given [Place] is the given local.
is_potentially_mutated
Checks whether it is possible that the given variable is mutated within the given [Expr].
is_todo_unimplemented_macro
Checks if the given expression is a macro call to todo!() or unimplemented!().
is_todo_unimplemented_stub
Checks if the given expression is a stub, i.e., a todo!() or unimplemented!() expression, or a block whose last expression is a todo!() or unimplemented!().
local_used_after_expr
Checks whether the given local is used after the given [Expr].
local_used_in
Checks whether the given Visitable (ex. an [Expr]) contains the given local.
mutated_variables
Returns a set of mutated local variable IDs, or None if mutations could not be determined.