x² shouldn't emit cast_sign_loss
#11642
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
Hi,
Clippy shoudn't lint about casting x2n as an unsigned integer since the result cannot be negative. The lint should still be shown for x3.
Lint Name
cast_sign_loss
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No output, as x² ⩾ 0.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: