mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 03:33:59 +00:00
68a58f255a
Co-authored-by: Josh Stone <jistone@redhat.com>
18 lines
542 B
Rust
18 lines
542 B
Rust
// 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"
|
|
};
|
|
}
|