rust/tests/ui/pattern/usefulness/explain-unreachable-pats.stderr
2024-08-19 21:57:37 +02:00

108 lines
3.1 KiB
Plaintext

error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:10:9
|
LL | (1 | 2,) => {}
| -------- matches all the relevant values
LL |
LL | (2,) => {}
| ^^^^ no value can reach this
|
note: the lint level is defined here
--> $DIR/explain-unreachable-pats.rs:2:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:21:9
|
LL | (1 | 2,) => {}
| ^^^^^^^^ no value can reach this
|
note: multiple earlier patterns match some of the same values
--> $DIR/explain-unreachable-pats.rs:21:9
|
LL | (1,) => {}
| ---- matches some of the same values
LL |
LL | (2,) => {}
| ---- matches some of the same values
LL |
LL | (1 | 2,) => {}
| ^^^^^^^^ collectively making this unreachable
error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:32:9
|
LL | Err(_) => {}
| ^^^^^^
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:46:9
|
LL | (Err(_), Err(_)) => {}
| ^^^^^^^^^^^^^^^^
|
= note: matches no values because `Void2` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:53:9
|
LL | (Err(_), Err(_)) => {}
| ^^^^^^^^^^^^^^^^
|
= note: matches no values because `Void1` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:63:11
|
LL | if let (0
| - matches all the relevant values
LL |
LL | | 0, _) = (0, 0) {}
| ^ no value can reach this
error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:73:9
|
LL | (_, true) => {}
| ^^^^^^^^^ no value can reach this
|
note: multiple earlier patterns match some of the same values
--> $DIR/explain-unreachable-pats.rs:73:9
|
LL | (true, _) => {}
| --------- matches some of the same values
LL |
LL | (false, _) => {}
| ---------- matches some of the same values
LL |
LL | (_, true) => {}
| ^^^^^^^^^ collectively making this unreachable
error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:86:9
|
LL | (true, _) => {}
| --------- matches all the relevant values
...
LL | (true, true) => {}
| ^^^^^^^^^^^^ no value can reach this
error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:98:9
|
LL | (_, true, 0..10) => {}
| ---------------- matches all the relevant values
...
LL | (_, true, 3) => {}
| ^^^^^^^^^^^^ no value can reach this
error: aborting due to 9 previous errors