Files
rust/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804-nan-match.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

87 lines
2.9 KiB
Plaintext
Raw Normal View History

2023-09-30 08:15:34 +02:00
error: cannot use NaN in patterns
2024-04-27 20:35:32 -04:00
--> $DIR/issue-6804-nan-match.rs:14:9
2023-09-30 08:15:34 +02:00
|
LL | const NAN: f64 = f64::NAN;
| -------------- constant defined here
...
2023-09-30 08:15:34 +02:00
LL | NAN => {},
| ^^^ evaluates to `NaN`, which is not allowed in patterns
2023-09-30 08:15:34 +02:00
|
= note: NaNs compare inequal to everything, even themselves, so this pattern would never match
= help: try using the `is_nan` method instead
error: cannot use NaN in patterns
2024-04-27 20:35:32 -04:00
--> $DIR/issue-6804-nan-match.rs:19:10
2023-09-30 08:15:34 +02:00
|
LL | const NAN: f64 = f64::NAN;
| -------------- constant defined here
...
2023-09-30 08:15:34 +02:00
LL | [NAN, _] => {},
| ^^^ evaluates to `NaN`, which is not allowed in patterns
2023-09-30 08:15:34 +02:00
|
= note: NaNs compare inequal to everything, even themselves, so this pattern would never match
= help: try using the `is_nan` method instead
error: cannot use NaN in patterns
2024-04-27 20:35:32 -04:00
--> $DIR/issue-6804-nan-match.rs:24:9
|
LL | const C: MyType<f32> = MyType(f32::NAN);
| -------------------- constant defined here
...
LL | C => {},
| ^ evaluates to `NaN`, which is not allowed in patterns
|
= note: NaNs compare inequal to everything, even themselves, so this pattern would never match
= help: try using the `is_nan` method instead
error: cannot use NaN in patterns
2024-04-27 20:35:32 -04:00
--> $DIR/issue-6804-nan-match.rs:30:9
2023-09-30 08:15:34 +02:00
|
LL | const NAN: f64 = f64::NAN;
| -------------- constant defined here
...
2023-09-30 08:15:34 +02:00
LL | NAN..=1.0 => {},
| ^^^ evaluates to `NaN`, which is not allowed in patterns
2023-09-30 08:15:34 +02:00
|
= note: NaNs compare inequal to everything, even themselves, so this pattern would never match
= help: try using the `is_nan` method instead
error: cannot use NaN in patterns
--> $DIR/issue-6804-nan-match.rs:31:16
2023-09-30 08:15:34 +02:00
|
LL | const NAN: f64 = f64::NAN;
| -------------- constant defined here
...
2023-09-30 08:15:34 +02:00
LL | -1.0..=NAN => {},
| ^^^ evaluates to `NaN`, which is not allowed in patterns
2023-09-30 08:15:34 +02:00
|
= note: NaNs compare inequal to everything, even themselves, so this pattern would never match
= help: try using the `is_nan` method instead
error: cannot use NaN in patterns
--> $DIR/issue-6804-nan-match.rs:32:9
2023-09-30 08:15:34 +02:00
|
LL | const NAN: f64 = f64::NAN;
| -------------- constant defined here
...
2023-09-30 08:15:34 +02:00
LL | NAN.. => {},
| ^^^ evaluates to `NaN`, which is not allowed in patterns
2023-09-30 08:15:34 +02:00
|
= note: NaNs compare inequal to everything, even themselves, so this pattern would never match
= help: try using the `is_nan` method instead
error: cannot use NaN in patterns
--> $DIR/issue-6804-nan-match.rs:33:11
2023-09-30 08:15:34 +02:00
|
LL | const NAN: f64 = f64::NAN;
| -------------- constant defined here
...
2023-09-30 08:15:34 +02:00
LL | ..NAN => {},
| ^^^ evaluates to `NaN`, which is not allowed in patterns
2023-09-30 08:15:34 +02:00
|
= note: NaNs compare inequal to everything, even themselves, so this pattern would never match
= help: try using the `is_nan` method instead
error: aborting due to 7 previous errors
2023-09-30 08:15:34 +02:00