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§
- 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.
Functions§
- visit_
attr_ πargs - visit_
attr_ πtt - visit_
attr_ πtts - visit_
attrs π - visit_
bounds π - 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_
const_ πitem - visit_
constness π - visit_
defaultness π - visit_
delim_ πargs - visit_
exprs π - visit_
lazy_ πtts - visit_
nonterminal πApplies the visitor to elements of interpolated nodes. - visit_
opt π - visit_
polarity π - visit_
safety π - visit_
thin_ πexprs - visit_
thin_ πvec - Applies ident visitor if itβs an ident; applies other visits to interpolated nodes. In practice the ident part is not actually used by specific visitors right now, but thereβs a test below checking that it works.
- visit_
tt π - visit_
tts π - visit_
vec π - walk_
anon_ πconst - walk_
attribute π - walk_
capture_ πby - walk_
closure_ πbinder - walk_
coroutine_ πkind - Mutates one item, returning the item again.
- 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_
generics π - walk_
ident π - walk_
inline_ πasm - walk_
inline_ πasm_ sym - walk_
label π - walk_
lifetime π - walk_
local π - walk_
mac π - walk_
macro_ πdef - walk_
meta_ πitem - walk_
meta_ πlist_ item - walk_mt π
- walk_
param_ πbound - walk_
path π - walk_
path_ πsegment - walk_
poly_ πtrait_ ref - walk_
qself π - walk_
trait_ πref - walk_
use_ πtree - walk_
variant_ πdata - walk_
vis π - walk_
where_ πclause - walk_
where_ πpredicate