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