Module rustc_ast::mut_visit

source Β·
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 in visit_clobber in the case where its closure panics.

Functions§