From 95b52d51eac77be1fcc624c2278dcaafa6989b0b Mon Sep 17 00:00:00 2001 From: Jana Dönszelmann Date: Sun, 9 Feb 2025 22:50:03 +0100 Subject: pretty print hir attributes --- compiler/rustc_macros/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'compiler/rustc_macros/src/lib.rs') diff --git a/compiler/rustc_macros/src/lib.rs b/compiler/rustc_macros/src/lib.rs index 0df674eb4c9..34fc0f00320 100644 --- a/compiler/rustc_macros/src/lib.rs +++ b/compiler/rustc_macros/src/lib.rs @@ -17,6 +17,7 @@ mod diagnostics; mod extension; mod hash_stable; mod lift; +mod print_attribute; mod query; mod serialize; mod symbols; @@ -175,3 +176,11 @@ decl_derive! { /// The error type is `u32`. try_from::try_from_u32 } +decl_derive! { + [PrintAttribute] => + /// Derives `PrintAttribute` for `AttributeKind`. + /// This macro is pretty specific to `rustc_attr_data_structures` and likely not that useful in + /// other places. It's deriving something close to `Debug` without printing some extraenous + /// things like spans. + print_attribute::print_attribute +} -- cgit 1.4.1-3-g733a5