mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
24 lines
340 B
Rust
24 lines
340 B
Rust
// run-pass
|
|
|
|
#![feature(if_let_guard)]
|
|
|
|
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!"),
|
|
| D if let 1 = 1 => println!("D!"),
|
|
| _ => {},
|
|
}
|
|
}
|
|
}
|