Expand description
A MutVisitor
represents an AST modification; it accepts an AST piece and
mutates it in place. So, for instance, macro expansion is a MutVisitor
that walks over an AST and modifies it.
Note: using a MutVisitor
(other than the MacroExpander
MutVisitor
) on
an AST before macro expansion is probably a bad idea. For instance,
a MutVisitor
renaming item names in a module will miss all of those
that are created by the expansion of a macro.
ModulesΒ§
- sealed π
MacrosΒ§
EnumsΒ§
TraitsΒ§
- MutVisitor
- Each method of this trait is a hook to be potentially
overridden. Each methodβs default implementation recursively visits
the substructure of the input via the corresponding
walk
method; e.g., thevisit_item
method by default callsvisit_mut::walk_item
. - Walk
Item Kind
FunctionsΒ§
- visit_
arms π - visit_
assoc_ πitems - visit_
bounds π - visit_
constness π - visit_
defaultness π - visit_
delim_ πargs - visit_
expr_ πfields - visit_
exprs π - visit_
field_ πdefs - visit_
foreign_ πitems - visit_
generic_ πparams - visit_
id π - helper since
Visitor
wantsNodeId
butMutVisitor
wants&mut NodeId
- visit_
items π - visit_
modifiers π - visit_
nested_ πuse_ tree - visit_
params π - visit_
pat_ πfields - visit_
polarity π - visit_
safety π - visit_
span π - visit_
stmts π - visit_
variants π - visit_
where_ πpredicates - walk_
anon_ const - walk_
arm - walk_
assoc_ item - walk_
assoc_ item_ constraint - walk_
attr_ args - walk_
attribute - walk_
block - walk_
capture_ πby - walk_
closure_ binder - walk_
const_ πitem - walk_
contract - walk_
coroutine_ πkind - walk_
crate - walk_
define_ πopaques - walk_
expr - walk_
expr_ field - walk_
field_ def - walk_
filter_ map_ expr - walk_
flat_ map_ arm - walk_
flat_ map_ assoc_ item - walk_
flat_ map_ expr_ field - walk_
flat_ map_ field_ def - walk_
flat_ map_ foreign_ item - walk_
flat_ map_ generic_ param - walk_
flat_ map_ item - walk_
flat_ map_ param - walk_
flat_ map_ pat_ field - walk_
flat_ map_ stmt - walk_
flat_ πmap_ stmt_ kind - walk_
flat_ map_ variant - walk_
flat_ map_ where_ predicate - walk_fn
- walk_
fn_ decl - walk_
fn_ header - walk_
fn_ ret_ ty - walk_
foreign_ πmod - walk_
format_ args - walk_
generic_ arg - walk_
generic_ args - walk_
generic_ param - walk_
generics - walk_
inline_ asm - walk_
inline_ asm_ sym - walk_
item - walk_
item_ πctxt - walk_
label - walk_
lifetime - walk_
local - walk_
mac - walk_
macro_ πdef - walk_
param - walk_
param_ bound - walk_
pat - walk_
pat_ field - walk_
path - walk_
path_ segment - walk_
poly_ trait_ ref - walk_
precise_ capturing_ arg - walk_
qself π - walk_
trait_ ref - walk_ty
- walk_
ty_ πalias_ where_ clauses - walk_
ty_ pat - walk_
use_ tree - walk_
variant - walk_
variant_ data - walk_
vis - walk_
where_ predicate - walk_
where_ predicate_ kind