Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Jan 10, 2024
1 parent 68a13bf commit 7945588
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tests/ui/rfcs/rfc-0000-never_patterns/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@ fn main() {
//~| ERROR: never patterns cannot contain variable bindings
}
}

fn void(void: Void) {
let (_a | !) = void;
let (! | _a) = void;
let ((_a, _) | (_a, _ | !)) = (true, void);
let (_a, (! | !)) = (true, void);
//~^ ERROR: never patterns cannot contain variable bindings
let (_a | (! | !,)) = (void,);
let ((_a,) | (!,)) = (void,);
}
8 changes: 7 additions & 1 deletion tests/ui/rfcs/rfc-0000-never_patterns/bindings.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@ error: never patterns cannot contain variable bindings
LL | Ok(_ok) | Err(&(_a, _b, !)) => {}
| ^^ help: use a wildcard `_` instead

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

error: aborting due to 5 previous errors

0 comments on commit 7945588

Please sign in to comment.