rust-lang / rust-lang/rust-analyzer
applying quick fix for clippy warning does not remove unused imports
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: 0.4.2064-standalone
rustc version: rustc 1.80.0 (051478957 2024-07-21)
editor or extension: Code oss
relevant settings: None
code snippet to reproduce:
use core::mem::size_of;
pub const USIZE_BITS: usize = size_of::<usize>() * 8;
This code (correctly) gives the clippy warning clippy::manual_bits. Fixing this with clippy (cargo clippy --fix) will remove the unused import, but fixing it with rust-analyzer ("Quick fix" menu) does not remove it.
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 reproducing the Rust snippet in the issue and compare rust-analyzer's Quick Fix with cargo clippy --fix. Trace the quick-fix handling for the clippy::manual_bits diagnostic; done means the rust-analyzer fix also removes the now-unused import.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100