Skip to main content

replace

Attribute Macro replace 

Source
#[replace]
Expand description

Replaces all occurrences of an identifier within the attached item.

For example, #[replace(Name => A, B, C)] will replace Name by A, B, C in the item the proc-macro is applied on.

The special case #[replace(Name => include(VisitableAstNodes))] will expand to a list of visitable AST nodes. This is useful in practice, as this list is often repeated.