From 9dd0ce3dc3467ebf154189f87be76ffcec8445f2 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 8 Jul 2026 21:52:34 -0700 Subject: [PATCH] Document prohibition on inner attribute macros Proc macro attributes as inner attributes are currently unstable via the `custom_inner_attributes` feature gate (https://github.com/rust-lang/rust/issues/54726). --- src/procedural-macros.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/procedural-macros.md b/src/procedural-macros.md index 00fd21c216..4de4d66386 100644 --- a/src/procedural-macros.md +++ b/src/procedural-macros.md @@ -317,6 +317,9 @@ Attribute macros can only be used on: - Inherent and trait [implementations] - [Trait definitions] +r[macro.proc.attribute.inner] +Attribute macros cannot be used as an [inner attribute]. + r[macro.proc.attribute.behavior] The first [`TokenStream`] parameter is the delimited token tree following the attribute's name but not including the outer delimiters. If the applied attribute contains only the attribute name or the attribute name followed by empty delimiters, the [`TokenStream`] is empty. @@ -394,6 +397,7 @@ Note that neither declarative nor procedural macros support doc comment tokens ( [function]: items/functions.md [implementations]: items/implementations.md [inert]: attributes.md#active-and-inert-attributes +[inner attribute]: attributes.inner [item]: items.md [items]: items.md [macro namespace]: names/namespaces.md