Confusing cmp_owned
false positive with <u32 as From<midly::primitive::u28>>::from
#8803
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
Unfortunately, I couldn't minimize it, but I tried linting this code. Specifically, this is the area that gave me grief:
I saw this happen:
I expected to see this happen:
Nothing. This comparison is fine as-is since
u32: Copy
, and removing the deref fails to compile. What might be the issue? Strangely enough, removingu32::from
silences the lint, even thoughFrom<midly::primitive::u28> for u32
doesn't allocate (it just unwraps a newtype, which only copies au32
).Lint Name
cmp_owned
Reproducer
See above
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: