Commit f100159
committed
Auto merge of rust-lang#7692 - workingjubilee:float-cmp-not-wrong, r=giraffate
Demote float_cmp to pedantic
See this issue: rust-lang/rust-clippy#7666
This is one of the most frequently suppressed lints. It is deny-by-default. It is not actually clearly wrong, as there are many instances where direct float comparison is actually desirable. It is only after operating on floats that they may lose precision, and that depends greatly on the operation. As most correctness lints have a much higher standard of error, being based on hard and fast binary logic, this should not be amongst them.
A linter is not a substitute for observing the math carefully and running tests, and doing the desirable thing is even more likely to lead one to want exact comparisons.
changelog: Demote [`float_cmp`] from correctness to pedantic lints2 files changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
| 1137 | + | |
1137 | 1138 | | |
1138 | 1139 | | |
1139 | 1140 | | |
| |||
1368 | 1369 | | |
1369 | 1370 | | |
1370 | 1371 | | |
1371 | | - | |
1372 | 1372 | | |
1373 | 1373 | | |
1374 | 1374 | | |
| |||
1733 | 1733 | | |
1734 | 1734 | | |
1735 | 1735 | | |
1736 | | - | |
1737 | 1736 | | |
1738 | 1737 | | |
1739 | 1738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
0 commit comments