Skip to content

Commit

Permalink
Unrolled build for rust-lang#130939
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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.
  • Loading branch information
rust-timer authored Sep 28, 2024
2 parents 150247c + 3b9db47 commit 6bd69e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rustdoc-json-types/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6bd69e9

Please sign in to comment.