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.
Enumsยง
Traitsยง
- Dummy
AstNode - Some value for the AST node that is valid but possibly meaningless. Similar
to
Default
but not intended for wide use. The value will never be used meaningfully, it exists just to support unwinding invisit_clobber
in the case where its closure panics. - Expect
One - MutVisitor
- Walk
Item Kind
Functionsยง
- noop_
filter_ map_ expr - visit_
attr_ ๐args - visit_
attrs ๐ - visit_
bounds ๐ - visit_
clobber - Use a map-style function (
FnOnce(T) -> T
) to overwrite a&mut T
. Useful when using aflat_map_*
orfilter_map_*
method within avisit_
method. - visit_
constness ๐ - visit_
defaultness ๐ - visit_
delim_ ๐args - visit_
exprs ๐ - visit_
opt ๐ - visit_
polarity ๐ - visit_
safety ๐ - visit_
thin_ ๐exprs - visit_
thin_ ๐vec - visit_
vec ๐ - walk_
angle_ ๐bracketed_ parameter_ data - walk_
anon_ ๐const - walk_
arm - walk_
assoc_ item - walk_
assoc_ ๐item_ constraint - 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_
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_
ident ๐ - walk_
inline_ ๐asm - walk_
inline_ ๐asm_ sym - walk_
item - walk_
item_ ๐ctxt - walk_
item_ kind - walk_
label ๐ - walk_
lifetime ๐ - walk_
local ๐ - walk_
mac ๐ - walk_
macro_ ๐def - walk_
meta_ ๐item - walk_
meta_ ๐list_ item - walk_
modifiers ๐ - walk_mt ๐
- walk_
param - walk_
param_ ๐bound - walk_
parenthesized_ ๐parameter_ data - 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_ ๐clause - walk_
where_ predicate_ kind