needless_borrow stopped triggering on references to Option<&_> if they're returned as part of a tuple #11786
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
I found out about this, because a project's CI pipeline failed on code for which a local invocation of
cargo clippy
reported no errors/warnings. I was able to pin this down to different versions of clippy being installed: clippy 0.1.72 reports the warning, while newer versions (see below) do not report it anymore.The original code is from a private project, so I created the shown more minimal reproducer.
This issue might have something in common with #11326 which was reported against 1.73.0; which is the first version this issue started showing up, afaict.
Lint Name
needless_borrow
Reproducer
I tried this code:
I expected to see this happen (as it happens with clippy 0.1.72 (b2b34bd 2023-06-06)):
Instead, this happened (with later clippy versions, starting at clippy 0.1.73 (cc66ad46 2023-10-03), see below):
Checking repro-needless-borrow v0.1.0 (/tmp/bla) Finished dev [unoptimized + debuginfo] target(s) in 0.10s
Version
The text was updated successfully, but these errors were encountered: