File tree Expand file tree Collapse file tree 2 files changed +15
-29
lines changed
tests/ui/rfcs/rfc-0000-never_patterns Expand file tree Collapse file tree 2 files changed +15
-29
lines changed Original file line number Diff line number Diff line change 1+ #![ feature( never_type) ]
12#![ feature( never_patterns) ]
23#![ allow( incomplete_features) ]
34
4- fn main ( ) {
5- match ( ) {
6- ( !|
7- //~^ ERROR: mismatched types
8- !) if true => { } //~ ERROR a never pattern is always unreachable
9- //~^ ERROR: mismatched types
5+ enum Void { }
6+
7+ fn foo ( x : Void ) {
8+ match x {
9+ ( !|!) if true => { } //~ ERROR a never pattern is always unreachable
1010 ( !|!) if true => { } //~ ERROR a never pattern is always unreachable
1111 }
1212}
13+
14+ fn main ( ) { }
Original file line number Diff line number Diff line change 11error: a never pattern is always unreachable
2- --> $DIR/ICE-133117-duplicate-never-arm.rs:8:23
2+ --> $DIR/ICE-133117-duplicate-never-arm.rs:9:26
33 |
4- LL | !) if true => {}
5- | ^^
6- | |
7- | this will never be executed
8- | help: remove this expression
4+ LL | (!| !) if true => {}
5+ | ^^
6+ | |
7+ | this will never be executed
8+ | help: remove this expression
99
1010error: a never pattern is always unreachable
1111 --> $DIR/ICE-133117-duplicate-never-arm.rs:10:26
@@ -16,21 +16,5 @@ LL | (!|!) if true => {}
1616 | this will never be executed
1717 | help: remove this expression
1818
19- error: mismatched types
20- --> $DIR/ICE-133117-duplicate-never-arm.rs:6:10
21- |
22- LL | (!|
23- | ^ a never pattern must be used on an uninhabited type
24- |
25- = note: the matched value is of type `()`
26-
27- error: mismatched types
28- --> $DIR/ICE-133117-duplicate-never-arm.rs:8:9
29- |
30- LL | !) if true => {}
31- | ^ a never pattern must be used on an uninhabited type
32- |
33- = note: the matched value is of type `()`
34-
35- error: aborting due to 4 previous errors
19+ error: aborting due to 2 previous errors
3620
You can’t perform that action at this time.
0 commit comments