diff options
Diffstat (limited to 'compiler/rustc_macros/src/lib.rs')
| -rw-r--r-- | compiler/rustc_macros/src/lib.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/compiler/rustc_macros/src/lib.rs b/compiler/rustc_macros/src/lib.rs index 1006ea3ba10..803b3621c88 100644 --- a/compiler/rustc_macros/src/lib.rs +++ b/compiler/rustc_macros/src/lib.rs @@ -21,6 +21,7 @@ mod symbols; mod try_from; mod type_foldable; mod type_visitable; +mod visitable; // Reads the rust version (e.g. "1.75.0") from the CFG_RELEASE env var and // produces a `RustcVersion` literal containing that version (e.g. @@ -101,6 +102,16 @@ decl_derive!( /// visited (and its type is not required to implement `TypeVisitable`). type_visitable::type_visitable_derive ); +decl_derive!( + [Walkable, attributes(visitable)] => + /// Derives `Walkable` for the annotated `struct` or `enum` (`union` is not supported). + /// + /// Each field of the struct or enum variant will be visited in definition order, using the + /// `Walkable` implementation for its type. However, if a field of a struct or an enum + /// variant is annotated with `#[visitable(ignore)]` then that field will not be + /// visited (and its type is not required to implement `Walkable`). + visitable::visitable_derive +); decl_derive!([Lift, attributes(lift)] => lift::lift_derive); decl_derive!( [Diagnostic, attributes( @@ -176,7 +187,7 @@ decl_derive! { decl_derive! { [PrintAttribute] => /// Derives `PrintAttribute` for `AttributeKind`. - /// This macro is pretty specific to `rustc_attr_data_structures` and likely not that useful in + /// This macro is pretty specific to `rustc_hir::attrs` and likely not that useful in /// other places. It's deriving something close to `Debug` without printing some extraneous /// things like spans. print_attribute::print_attribute |
