2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2023-09-18 15:18:51 +00:00
|
|
|
|
|
|
|
#![feature(if_let_guard)]
|
|
|
|
|
2018-01-30 14:56:02 -06: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 14:56:02 -06:00
|
|
|
| _ => {},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|