Skip to content

Commit 667db34

Browse files
Add back the E0003 error code long explanation
1 parent 4eee955 commit 667db34

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/librustc_error_codes/error_codes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
register_diagnostics! {
1111
E0001: include_str!("./error_codes/E0001.md"),
1212
E0002: include_str!("./error_codes/E0002.md"),
13+
E0003: include_str!("./error_codes/E0003.md"),
1314
E0004: include_str!("./error_codes/E0004.md"),
1415
E0005: include_str!("./error_codes/E0005.md"),
1516
E0007: include_str!("./error_codes/E0007.md"),
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#### Note: this error code is no longer emitted by the compiler.
2+
3+
Not-a-Number (NaN) values cannot be compared for equality and hence can never
4+
match the input to a match expression. To match against NaN values, you should
5+
instead use the `is_nan()` method in a guard, like so:
6+
7+
```
8+
let number = 0f64;
9+
10+
match number {
11+
// ...
12+
x if x.is_nan() => { /* ... */ }
13+
x => { /* ... */ }
14+
}
15+
```

0 commit comments

Comments
 (0)