rust-lang / rust-lang/rust-analyzer
False positive unused_variables on never-type
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: rust-analyzer 0.4.2991-standalone
rustc version: rustc 1.97.0-nightly (36ba2c771 2026-04-23)
editor or extension: Vim
code snippet to reproduce:
fn main() {
let foo = loop {};
_ = foo; // used
}
Cursor on foo (line 2)
Expect no this quickfix, but actual output Rename unused foo to _foo
After apply:
fn main() {
let _foo = loop {};
_ = foo; // used
}
Should either 'not applicable' or 'rename all usage'
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 unused_variables quickfix with the minimal Rust snippet in the issue, using the reported rust-analyzer version and Vim setup. Trace the diagnostic and rename action for a variable initialized with never-type control flow, then verify that the quickfix is absent or renames every usage, including _ = foo.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100