]> git.proxmox.com Git - rustc.git/blob - tests/ui/parser/match-arm-without-body.rs
New upstream version 1.76.0+dfsg1
[rustc.git] / tests / ui / parser / match-arm-without-body.rs
1 macro_rules! pat {
2 () => { Some(_) }
3 }
4
5 fn main() {
6 match Some(false) {
7 Some(_)
8 //~^ ERROR `match` arm with no body
9 //~| HELP add a body after the pattern
10 }
11 match Some(false) {
12 Some(_)
13 _ => {}
14 //~^ ERROR expected one of
15 }
16 match Some(false) {
17 Some(_),
18 //~^ ERROR unexpected `,` in pattern
19 //~| HELP try adding parentheses to match on a tuple
20 //~| HELP or a vertical bar to match on multiple alternatives
21 }
22 match Some(false) {
23 Some(_),
24 //~^ ERROR unexpected `,` in pattern
25 //~| HELP try adding parentheses to match on a tuple
26 //~| HELP or a vertical bar to match on multiple alternatives
27 _ => {}
28 }
29 match Some(false) {
30 Some(_) if true
31 //~^ ERROR `match` arm with no body
32 //~| HELP add a body after the pattern
33 }
34 match Some(false) {
35 Some(_) if true
36 _ => {}
37 //~^ ERROR expected one of
38 }
39 match Some(false) {
40 Some(_) if true,
41 //~^ ERROR `match` arm with no body
42 //~| HELP add a body after the pattern
43 }
44 match Some(false) {
45 Some(_) if true,
46 //~^ ERROR `match` arm with no body
47 //~| HELP add a body after the pattern
48 _ => {}
49 }
50 match Some(false) {
51 pat!()
52 //~^ ERROR `match` arm with no body
53 //~| HELP add a body after the pattern
54 }
55 match Some(false) {
56 pat!(),
57 //~^ ERROR `match` arm with no body
58 //~| HELP add a body after the pattern
59 }
60 match Some(false) {
61 pat!() if true,
62 //~^ ERROR `match` arm with no body
63 //~| HELP add a body after the pattern
64 }
65 match Some(false) {
66 pat!()
67 //~^ ERROR expected `,` following `match` arm
68 //~| HELP missing a comma here
69 _ => {}
70 }
71 match Some(false) {
72 pat!(),
73 //~^ ERROR `match` arm with no body
74 //~| HELP add a body after the pattern
75 _ => {}
76 }
77 }