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_
attr_ πtt - visit_
attr_ πtts - 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_
delim_ span - visit_
exprs π - visit_
lazy_ πtts - visit_
lazy_ πtts_ opt_ mut - visit_
nonterminal π - Applies the visitor to elements of interpolated nodes.
- visit_
opt π - visit_
polarity π - visit_
safety π - visit_
thin_ πexprs - visit_
thin_ πvec - visit_
token - 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_
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