File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
tests/ui/rfcs/rfc-0000-never_patterns Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments