rust-lang / rust-lang/rust-clippy
Lint suggestion: warn on `use` statements already imported via the prelude
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
A large number of traits, types and functions are imported into a rust crate implicitly through the standard prelude. However, when you explicitly bring one of these items in the prelude into scope using the use statement, the rust compiler doesn't warn that the use is unnecessary.
A clippy warning for this could help shave unnecessary lines. This should probably not run on crates with #![no_std]
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 by reviewing how Clippy implements lints for unnecessary use statements and how it identifies items from Rust's standard prelude. Check the #![no_std] case explicitly. Done means the lint warns for redundant prelude imports while remaining inactive for no-std crates, with coverage for both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100