rust-lang / rust-lang/rust-clippy

Warn on unused/unnecessary trait bounds

Open
#1,463 1 comment 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

I sometimes overspecify the trait bounds on an impl by accident. In many cases, some of the bounds aren't actually needed. It would be nice to have a lint I could run to warn me whenever I've done this so I could clean it up.

There are cases when you want to overspecify the trait boundaries so you can add things to them without breaking backwards compatibility, but in these cases you'd just ignore the lint or turn it off.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the issue description to define which impl trait bounds count as unnecessary and how intentional overspecification should be handled. Done means Clippy warns about removable bounds while allowing the lint to be ignored or disabled.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.