integer_division
false negative for NonZero
denominators
#14652
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Summary
The
integer_division
lint, as I've understood it, is meant to restrict the use of integer division. When dividing an integer by aNonZero
version of it, whilst safe from division-by-zero errors, the remainder is still discarded. I believe that this lint should be emitted in such cases, but currently, it is not.Lint Name
integer_division
Reproducer
I tried this code:
I expected to see this happen:
I expected
x / TWO
to produce a warning.Instead, this happened:
No warning was emitted.
Version
The text was updated successfully, but these errors were encountered: