False negative clone-on-copy #5436
Labels
C-bug
Category: Clippy is not doing the correct thing
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
Hi folks,
I ran this code under Clippy:
Clippy produced this error:
I expected to see same error in
vec.push(key.clone())
but Clippy is silent about it. After removing.clone()
in line 5 it does compile fine, so I assume it is redundant.Can someone explain to me what is the difference here?
Output of
cargo clippy -V
clippy 0.0.212 (4ee1206 2020-02-01)
The text was updated successfully, but these errors were encountered: