about summary refs log tree commit diff
path: root/tests/ui/feature-gates/feature-gate-postfix_match.rs
blob: 2226816e5ea7c8113d50549d651e27763750f81f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Testing that postfix match doesn't work without enabling the feature

fn main() {
    let val = Some(42);

    val.match { //~ ERROR postfix match is experimental
        Some(42) => "the answer to life, the universe, and everything",
        _ => "might be the answer to something"
    };

    // Test that the gate works behind a cfg
    #[cfg(false)]
    val.match { //~ ERROR postfix match is experimental
        Some(42) => "the answer to life, the universe, and everything",
        _ => "might be the answer to something"
    };
}