rust/tests/ui/binding/match-beginning-vert.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
340 B
Rust
Raw Normal View History

// run-pass
2023-09-18 15:18:51 +00:00
#![feature(if_let_guard)]
2018-01-30 20:56:02 +00:00
enum Foo {
A,
B,
C,
D,
E,
}
use Foo::*;
fn main() {
for foo in &[A, B, C, D, E] {
match *foo {
| A => println!("A"),
| B | C if 1 < 2 => println!("BC!"),
2023-09-18 15:18:51 +00:00
| D if let 1 = 1 => println!("D!"),
2018-01-30 20:56:02 +00:00
| _ => {},
}
}
}