rust-lang / rust-lang/rust-clippy
Imply #[allow(clippy::some_categories)] when #[automatically_derived] is encountered
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
The #[automatically_derived] attribute is used by builtin rustc derives to indicate that the code inside the impl is autogenerated and suppress some categories of warnings, like dead code and unused variables. Furthermore, some derive macros also annotate the generated code with this attribute, like serde_derive.
I think it would be nice for this attribute to also suppress some groups of clippy warnings, namely restriction, style, pedantic, complexity, and maybe nursery.
I believe this would be better than asking derives to apply #[allow(clippy::all)] because clippy::all implies correctness and perf, but those lints are useful even for generated code.
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
No implementation files or tests are named. Start by tracing Clippy's handling of the automatically_derived attribute and how lint groups are suppressed; done means restriction, style, pedantic, and complexity warnings are suppressed for generated code while correctness and performance warnings remain enabled, with the nursery decision resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100