Skip to content

Commit 7945588

Browse files
committed
Add more tests
1 parent 68a13bf commit 7945588

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

tests/ui/rfcs/rfc-0000-never_patterns/bindings.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,13 @@ fn main() {
2323
//~| ERROR: never patterns cannot contain variable bindings
2424
}
2525
}
26+
27+
fn void(void: Void) {
28+
let (_a | !) = void;
29+
let (! | _a) = void;
30+
let ((_a, _) | (_a, _ | !)) = (true, void);
31+
let (_a, (! | !)) = (true, void);
32+
//~^ ERROR: never patterns cannot contain variable bindings
33+
let (_a | (! | !,)) = (void,);
34+
let ((_a,) | (!,)) = (void,);
35+
}

tests/ui/rfcs/rfc-0000-never_patterns/bindings.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,11 @@ error: never patterns cannot contain variable bindings
2222
LL | Ok(_ok) | Err(&(_a, _b, !)) => {}
2323
| ^^ help: use a wildcard `_` instead
2424

25-
error: aborting due to 4 previous errors
25+
error: never patterns cannot contain variable bindings
26+
--> $DIR/bindings.rs:31:10
27+
|
28+
LL | let (_a, (! | !)) = (true, void);
29+
| ^^ help: use a wildcard `_` instead
30+
31+
error: aborting due to 5 previous errors
2632

0 commit comments

Comments
 (0)