absurd extreme comparisons not working for std::time::Duration #14524
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
Duration
values cannot be negative under any circumstance, so it's not useful to check if aDuration
is less than zero. Please make sure allDuration
s which can be const evaluated to zero, are treated as zero for the purposes of this lint.Lint Name
absurd_extreme_comparisons
Reproducer
I tried this code:
I expected to see this happen: absurd_extreme_comparisons lint activates
Instead, this happened: no lint is triggered, code is accepted as is
Version
The text was updated successfully, but these errors were encountered: