MutVisitor represents an AST modification; it accepts an AST piece and
mutates it in place. So, for instance, macro expansion is a
that walks over an AST and modifies it.
Note: using a
MutVisitor (other than the
an AST before macro expansion is probably a bad idea. For instance,
MutVisitor renaming item names in a module will miss all of those
that are created by the expansion of a macro.
- Some value for the AST node that is valid but possibly meaningless.
- Use a map-style function (
FnOnce(T) -> T) to overwrite a
&mut T. Useful when using a
filter_map_*method within a
- Applies the visitor to elements of interpolated nodes.
- 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.