rust/library
bors 788c98df59 Auto merge of #111818 - Urgau:uplift_cmp_nan, r=cjgillot
Uplift `clippy::cmp_nan` lint

This PR aims at uplifting the `clippy::cmp_nan` lint into rustc.

## `invalid_nan_comparisons`

~~(deny-by-default)~~ (warn-by-default)

The `invalid_nan_comparisons` lint checks comparison with `f32::NAN` or `f64::NAN` as one of the operand.

### Example

```rust,compile_fail
let a = 2.3f32;
if a == f32::NAN {}
```

### Explanation

NaN does not compare meaningfully to anything – not even itself – so those comparisons are always false.

-----

Mostly followed the instructions for uplifting a clippy lint described here: https://github.com/rust-lang/rust/pull/99696#pullrequestreview-1134072751

`@rustbot` label: +I-lang-nominated
r? compiler
2023-06-10 12:47:51 +00:00
..
alloc Remove ExtendWith and ExtendElement 2023-06-04 15:55:34 +02:00
backtrace@4245978ca8
core Auto merge of #111818 - Urgau:uplift_cmp_nan, r=cjgillot 2023-06-10 12:47:51 +00:00
panic_abort
panic_unwind
portable-simd Explicit set workspace.resolver = "1" 2023-05-31 00:08:11 +01:00
proc_macro
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #112292 - thomcc:tls-ohno, r=m-ou-se 2023-06-08 04:44:08 +00:00
stdarch@7e2cdc675b
sysroot
test Auto merge of #111348 - ozkanonur:remove-hardcoded-rustdoc-flags, r=albertlarsan68,oli-obk 2023-05-27 04:20:44 +00:00
unwind