rust-lang / rust-lang/rust-clippy
lint traits with only one implementor
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Traits are awesome, as they allow us to decouple the behavior from the data.
However, sometimes they may be overused, leading to indirection and making it harder to read the code than strictly necessary (because one has to look up the trait impls; and there is always the risk other code may also implement those traits).
So, I'd like to (allow for now) lint traits that have only one implementing type, to allow people to quickly identify extension points that have not yet been used, so they can get rid of them and make life easier for rustc and fellow coders.
The lint could either be split in two (for public/private traits), where the former would be allowed, or we allow for aboolean config flag.
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
The issue names no files, tests, or entry points, so first review the rust-clippy repository structure and existing lint implementations. Clarify whether the work should cover public and private traits and how the proposed configuration should behave; done means an agreed design, implementation, and tests for traits with exactly one implementing type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100