Skip to content

Commit 7e32221

Browse files
authored
Rollup merge of #130939 - obi1kenobi:patch-2, r=aDotInTheVoid
rustdoc: update `ProcMacro` docs section on helper attributes I believe the mention of attribute macros in the section on proc macro helper attributes is erroneous. As far as I can tell, attribute macros cannot define helper attributes. The following attribute macro is not valid (fails to build), no matter how I try to define (or skip defining) the helpers: ```rust #[proc_macro_attribute(attributes(helper))] pub fn attribute_helpers(_attr: TokenStream, item: TokenStream) -> TokenStream { item } ``` The [language reference](https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros) also doesn't seem to mention attribute macro helpers. The helpers subsection is inside the section on derive macros.
2 parents 2df6b07 + 3b9db47 commit 7e32221

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rustdoc-json-types/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ pub struct ProcMacro {
11681168
pub kind: MacroKind,
11691169
/// Helper attributes defined by a macro to be used inside it.
11701170
///
1171-
/// Defined only for attribute & derive macros.
1171+
/// Defined only for derive macros.
11721172
///
11731173
/// E.g. the [`Default`] derive macro defines a `#[default]` helper attribute so that one can
11741174
/// do:

0 commit comments

Comments
 (0)