3 #![feature(if_let_guard)]
4 #![allow(incomplete_features)]
12 fn bar(x: bool) -> Foo {
13 if x { Foo::Baz } else { Foo::Bar }
16 fn baz(x: u8) -> Foo {
17 if x % 2 == 0 { Foo::Bar } else { Foo::Baz }
20 fn qux(x: u8) -> Foo {
21 Foo::Qux(x.rotate_left(1))
25 match Some((true, 3)) {
26 Some((x, _)) if let Foo::Bar = bar(x) => panic!(),
27 Some((_, x)) if let Foo::Baz = baz(x) => {},
31 Some(x) if let Foo::Qux(y) = qux(x) => assert_eq!(y, 84),