about summary refs log tree commit diff
path: root/compiler/rustc_macros/src/lib.rs
diff options
context:
space:
mode:
authorJana Dönszelmann <jana@donsz.nl>2025-02-09 22:50:03 +0100
committerJana Dönszelmann <jana@donsz.nl>2025-02-24 14:31:19 +0100
commit95b52d51eac77be1fcc624c2278dcaafa6989b0b (patch)
treea952e5797f050dc9a4cfd4cae3e4483e9e83fe55 /compiler/rustc_macros/src/lib.rs
parent309b46ad68d15377edd95836796bceb196b2d1b8 (diff)
downloadrust-95b52d51eac77be1fcc624c2278dcaafa6989b0b.tar.gz
rust-95b52d51eac77be1fcc624c2278dcaafa6989b0b.zip
pretty print hir attributes
Diffstat (limited to 'compiler/rustc_macros/src/lib.rs')
-rw-r--r--compiler/rustc_macros/src/lib.rs9
1 files changed, 9 insertions, 0 deletions
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
+}