rust/tests/ui/feature-gates/feature-gate-postfix_match.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
542 B
Rust
Raw Normal View History

// 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"
};
}