2023-11-26 18:08:39 -06:00
|
|
|
macro_rules! pat {
|
|
|
|
() => { Some(_) }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match Some(false) {
|
|
|
|
Some(_)
|
2023-11-26 18:53:05 -06:00
|
|
|
//~^ ERROR `match` arm with no body
|
|
|
|
//~| HELP add a body after the pattern
|
2023-11-26 18:08:39 -06:00
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
Some(_)
|
|
|
|
_ => {}
|
|
|
|
//~^ ERROR expected one of
|
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
Some(_),
|
|
|
|
//~^ ERROR unexpected `,` in pattern
|
|
|
|
//~| HELP try adding parentheses to match on a tuple
|
|
|
|
//~| HELP or a vertical bar to match on multiple alternatives
|
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
Some(_),
|
|
|
|
//~^ ERROR unexpected `,` in pattern
|
|
|
|
//~| HELP try adding parentheses to match on a tuple
|
|
|
|
//~| HELP or a vertical bar to match on multiple alternatives
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
Some(_) if true
|
2023-11-26 18:53:05 -06:00
|
|
|
//~^ ERROR `match` arm with no body
|
|
|
|
//~| HELP add a body after the pattern
|
2023-11-26 18:08:39 -06:00
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
Some(_) if true
|
|
|
|
_ => {}
|
|
|
|
//~^ ERROR expected one of
|
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
Some(_) if true,
|
2023-11-26 18:53:05 -06:00
|
|
|
//~^ ERROR `match` arm with no body
|
|
|
|
//~| HELP add a body after the pattern
|
2023-11-26 18:08:39 -06:00
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
Some(_) if true,
|
2023-11-26 18:53:05 -06:00
|
|
|
//~^ ERROR `match` arm with no body
|
|
|
|
//~| HELP add a body after the pattern
|
2023-11-26 18:08:39 -06:00
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
pat!()
|
2023-11-26 18:53:05 -06:00
|
|
|
//~^ ERROR `match` arm with no body
|
|
|
|
//~| HELP add a body after the pattern
|
2023-11-26 18:08:39 -06:00
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
pat!(),
|
2023-11-26 18:53:05 -06:00
|
|
|
//~^ ERROR `match` arm with no body
|
|
|
|
//~| HELP add a body after the pattern
|
2023-11-26 18:08:39 -06:00
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
pat!() if true,
|
2023-11-26 18:53:05 -06:00
|
|
|
//~^ ERROR `match` arm with no body
|
|
|
|
//~| HELP add a body after the pattern
|
2023-11-26 18:08:39 -06:00
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
pat!()
|
2023-11-26 20:15:56 -06:00
|
|
|
//~^ ERROR expected `,` following `match` arm
|
|
|
|
//~| HELP missing a comma here
|
2023-11-26 18:08:39 -06:00
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
match Some(false) {
|
|
|
|
pat!(),
|
2023-11-26 18:53:05 -06:00
|
|
|
//~^ ERROR `match` arm with no body
|
|
|
|
//~| HELP add a body after the pattern
|
2023-11-26 18:08:39 -06:00
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|