rust-lang / rust-lang/rust-clippy
Lint about range intersections in `if … else if` sequences
Open
Nobody has claimed this yet.
A-lint
E-medium
L-correctness
T-middle
T-MIR
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
We could warn for stuff like that:
if (a < 42) {
…
} else (a < 7) { // It is commonly admitted that 7 < 42
…
}
See http://www.viva64.com/en/examples/V695/. Cc #1175.
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 example in the issue and review rust-clippy's existing lint implementations for conditional branches. Use the linked V695 reference to clarify the intended warning, then define completion as detecting the redundant range intersection and covering the behavior with 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