Skip to content

Commit 0385dd4

Browse files
committed
Fix ICE-130779
Signed-off-by: Shunpoco <[email protected]>
1 parent 8c0c149 commit 0385dd4

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(never_patterns)]
2+
#![allow(incomplete_features)]
3+
4+
enum E { A }
5+
6+
fn main() {
7+
match E::A {
8+
! | //~ ERROR: a trailing `|` is not allowed in an or-pattern
9+
//~^ ERROR: mismatched types
10+
if true => {} //~ ERROR: a never pattern is always unreachable
11+
}
12+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
error: a trailing `|` is not allowed in an or-pattern
2+
--> $DIR/ICE-130779-never-arm-no-oatherwise-block.rs:8:11
3+
|
4+
LL | ! |
5+
| - ^
6+
| |
7+
| while parsing this or-pattern starting here
8+
|
9+
help: remove the `|`
10+
|
11+
LL - ! |
12+
LL + !
13+
|
14+
15+
error: a never pattern is always unreachable
16+
--> $DIR/ICE-130779-never-arm-no-oatherwise-block.rs:10:20
17+
|
18+
LL | if true => {}
19+
| ^^
20+
| |
21+
| this will never be executed
22+
| help: remove this expression
23+
24+
error: mismatched types
25+
--> $DIR/ICE-130779-never-arm-no-oatherwise-block.rs:8:9
26+
|
27+
LL | ! |
28+
| ^ a never pattern must be used on an uninhabited type
29+
|
30+
= note: the matched value is of type `E`
31+
32+
error: aborting due to 3 previous errors
33+

0 commit comments

Comments
 (0)