File tree 2 files changed +46
-1
lines changed
tests/ui/rfcs/rfc-0000-never_patterns
2 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -23,3 +23,24 @@ fn main() {
23
23
//~| ERROR: never patterns cannot contain variable bindings
24
24
}
25
25
}
26
+
27
+ fn void ( void : Void ) {
28
+ let ( _a | !) = void;
29
+ let ( ! | _a) = void;
30
+ let ( ( _a, _) | ( _a, _ | !) ) = ( true , void) ;
31
+ let ( _a | ( ! | !, ) ) = ( void, ) ;
32
+ let ( ( _a, ) | ( !, ) ) = ( void, ) ;
33
+
34
+ let ( _a, ( ! | !) ) = ( true , void) ;
35
+ //~^ ERROR: never patterns cannot contain variable bindings
36
+ let ( _a, ( _b | !) ) = ( true , void) ;
37
+
38
+ let _a @ ! = void;
39
+ //~^ ERROR: never patterns cannot contain variable bindings
40
+ let _a @ ( _b | !) = void;
41
+ let ( _a @ ( ) , !) = ( ( ) , void) ;
42
+ //~^ ERROR: never patterns cannot contain variable bindings
43
+ let ( _a |
44
+ ( _b @ ( _, !) ) ) = ( true , void) ;
45
+ //~^ ERROR: never patterns cannot contain variable bindings
46
+ }
Original file line number Diff line number Diff line change @@ -22,5 +22,29 @@ error: never patterns cannot contain variable bindings
22
22
LL | Ok(_ok) | Err(&(_a, _b, !)) => {}
23
23
| ^^ help: use a wildcard `_` instead
24
24
25
- error: aborting due to 4 previous errors
25
+ error: never patterns cannot contain variable bindings
26
+ --> $DIR/bindings.rs:34:10
27
+ |
28
+ LL | let (_a, (! | !)) = (true, void);
29
+ | ^^ help: use a wildcard `_` instead
30
+
31
+ error: never patterns cannot contain variable bindings
32
+ --> $DIR/bindings.rs:38:9
33
+ |
34
+ LL | let _a @ ! = void;
35
+ | ^^ help: use a wildcard `_` instead
36
+
37
+ error: never patterns cannot contain variable bindings
38
+ --> $DIR/bindings.rs:41:10
39
+ |
40
+ LL | let (_a @ (), !) = ((), void);
41
+ | ^^ help: use a wildcard `_` instead
42
+
43
+ error: never patterns cannot contain variable bindings
44
+ --> $DIR/bindings.rs:44:14
45
+ |
46
+ LL | (_b @ (_, !))) = (true, void);
47
+ | ^^ help: use a wildcard `_` instead
48
+
49
+ error: aborting due to 8 previous errors
26
50
You can’t perform that action at this time.
0 commit comments