clippy::useless_asref warns in cases where map callback performs a method call before a clone #12135
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
The new
clippy::useless_asref
warning is overly aggressive.Lint Name
clippy::useless_asref
Reproducer
Given the following code:
Clippy emits the following warning:
However, this is not correct,
x.field.clone()
totally drops the call tomethod()
.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: