From 8c635581186431ad48c24d694858b0f7b2badc3a 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 6c147d3421..18826351c0 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.outline-mod] For any [outline modules] present in the macro's input, only the tokens of the module declaration are passed; the file contents of the module are not loaded or included in the input. @@ -397,6 +400,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