3 #![feature(if_let_guard)]
11 fn bar(x: bool) -> Foo {
12 if x { Foo::Baz } else { Foo::Bar }
15 fn baz(x: u8) -> Foo {
16 if x % 2 == 0 { Foo::Bar } else { Foo::Baz }
19 fn qux(x: u8) -> Foo {
20 Foo::Qux(x.rotate_left(1))
24 match Some((true, 3)) {
25 Some((x, _)) if let Foo::Bar = bar(x) => panic!(),
26 Some((_, x)) if let Foo::Baz = baz(x) => {},
30 Some(x) if let Foo::Qux(y) = qux(x) => assert_eq!(y, 84),