about summary refs log tree commit diff
path: root/tests/rustdoc-js/slice-array.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-10 12:47:51 +0000
committerbors <bors@rust-lang.org>2023-06-10 12:47:51 +0000
commit788c98df5995c9fe360ba9ba5efb103ee69d05c4 (patch)
tree899ba7b18bc831fbfb002da17a22bd6dccf37050 /tests/rustdoc-js/slice-array.js
parent4b71d79c972a605959b0a7c82b323fbd8562f070 (diff)
parenta8145372d70f0aeee27546219bdc9564420cc974 (diff)
downloadrust-788c98df5995c9fe360ba9ba5efb103ee69d05c4.tar.gz
rust-788c98df5995c9fe360ba9ba5efb103ee69d05c4.zip
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
Diffstat (limited to 'tests/rustdoc-js/slice-array.js')
0 files changed, 0 insertions, 0 deletions