rust-lang / rust-lang/rust-clippy
op_ref false positive
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
With the following code: https://play.rust-lang.org/?gist=1aa5789d7082019e91bac7b093304ad5&version=stable
Clippy suggests removing the reference, but without the reference the Rust compiler complains that type annotations are needed.
I would expect the lint to not fire in this case.
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 running the linked Rust Playground example with Clippy and confirm the op_ref false positive. Then locate the op_ref lint implementation and its tests, and compare the diagnostic with the compiler error produced when the reference is removed. Done means the lint no longer fires for this case while existing op_ref behavior remains covered.
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
- Mostly clear
- Newbie friendliness
- 35/100