Incorrect: this expression borrows a value the compiler would automatically borrow
#8407
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
Clippy claims that a compiler would automatically borrow specific user borrows. E.g.
(&impl Struct)
. These explicit borrows are done to dispatch to a implementation on the reference. So that owned code can utilize the same implementation.Lint Name
needless_borrow
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No warning.
Doing as the lint suggests, leads to recursive call site
So that's a catch 22.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: