false positive: variable does not need to be mutable
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Summary
I had a false positive unused_mut, after fixing it - re-running cargo clippy still threw the warning. Seems it could have some sort of cache issue as after doing cargo clean, the lint no longer threw the warning.
Lint Name
unused_mut
Reproducer
I haven't managed to reproduce this since, but just a simple:
let (tx, mut rx) = mpsc::unbounded_channel();- run
cargo clippy - remove the
mut - lint still remained
cargo clean- lint now no longer warned
Version
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-unknown-linux-gnu
release: 1.81.0
LLVM version: 18.1.7
Additional Labels
No response
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 trying to reproduce the unused_mut warning with the reported mpsc::unbounded_channel example under rustc 1.81.0, running cargo clippy before and after removing mut and then after cargo clean. The issue provides no source file or test entry point, so first establish a reliable reproducer; done means the stale warning no longer persists after the code change without requiring cargo clean.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100