diff options
| author | Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com> | 2024-09-27 14:34:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-27 14:34:48 -0400 |
| commit | 3b9db47f07e2b609dc2acf45b0eaa7239ef76f49 (patch) | |
| tree | b2bd850b3ab69988481309858e477e1f681d9a2f /src | |
| parent | a3f76a26e045a760bb1163b7eab36872985242d5 (diff) | |
| download | rust-3b9db47f07e2b609dc2acf45b0eaa7239ef76f49.tar.gz rust-3b9db47f07e2b609dc2acf45b0eaa7239ef76f49.zip | |
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.Diffstat (limited to 'src')
| -rw-r--r-- | src/rustdoc-json-types/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index ef21779b099..b3707cf6157 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -1168,7 +1168,7 @@ pub struct ProcMacro { pub kind: MacroKind, /// Helper attributes defined by a macro to be used inside it. /// - /// Defined only for attribute & derive macros. + /// Defined only for derive macros. /// /// E.g. the [`Default`] derive macro defines a `#[default]` helper attribute so that one can /// do: |
