rust-lang / rust-lang/reference
Should `#[automatically_derived]` docs contain advice for derive macros?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- PR merge metrics
- PR metrics pending
Description
The documentation for #[automatically_derived] currently states:
The
automatically_derivedattribute is automatically added to implementations created by the derive attribute for built-in traits. It has no direct effect, but it may be used by tools and diagnostic lints to detect these automatically generated implementations.
I think the suggestion that this is only for built-in traits is incomplete; it's in use by many crates, including serde, clap, bevy, yew...
Also the "may be used by tools and diagnostic lints" seems vague: is this attribute recommended for use in derive macro output, for the purpose of suppressing clippy lints? Would this strategy be not recommended? I have seen a few github issues on proc-macro crates, and it does not seem like this attribute is well understood by crate authors.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current #[automatically_derived] documentation and the linked examples from serde, clap, bevy, and yew. Done means the Reference clearly explains whether derive macros should use the attribute, how it relates to tools and diagnostic lints, and whether suppressing Clippy lints is recommended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100