needless_pass_by_ref_mut: false negative, &mut self ignored #12589
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Summary
Looks like mutable self refs ignored in methods.
Discovered while working on rust-lang/rust#123188
Checked with clippy from playground 0.1.79 (2024-03-27 c9f8f34)
https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=1eb816feca6371e80e4b27f59b21174f
see also #9591
Lint Name
needless_pass_by_ref_mut
Reproducer
I tried this code:
I expected to see this happen:
Should warn about unused &mut self in
foo
andbar
Instead, this happened:
No warn for &mut self, only for
y
:Version
No response
The text was updated successfully, but these errors were encountered: