cmp_nan only compares against NaN constant #1205
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
good-first-issue
These issues are a good way to get started with Clippy
T-MIR
Type: This lint will require working with the MIR
IIUC, the
cmp_nan
lint just checks whether an expression is a constant whose last path segement isNAN
.That means that
works as expected but more complicated (but still rather trivial) stuff like
does not produce any of the expected errors.
Since the lint is only supposed to work with those standard number representations that have a
NaN
value (i.e. f32, f64, f128), the number of cases that evaluate to NaN is hopefully not that large and can probably be hard coded.The text was updated successfully, but these errors were encountered: