rust-lang / rust-lang/rust-clippy
Redundant trait bounds
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
From time to time I find redundancies in my code as the result of moving trait bounds around while refactoring.
While true redundancy detection (with indirection) is probably out of scope …
trait Baz {}
trait Bar: Baz {}
trait Foo<T>
where T: Bar {
fn foo() where T: Baz;
}
… trivial cases like this should be totally doable:
trait Bar {}
trait Foo<T>
where T: Bar {
fn foo() where T: Bar;
}
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 with the two Rust examples in the issue and trace how rust-clippy implements lint checks for trait bounds. Determine how the repeated bound should be identified without attempting indirect redundancy detection. Done means the trivial redundant-bound case is reported while the indirect case remains out of scope; the payload names no files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100