rust/tests/ui/feature-gates/feature-gate-yeet_expr-in-cfg.rs

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

20 lines
329 B
Rust
Raw Normal View History

//@ compile-flags: --edition 2021
pub fn demo() -> Option<i32> {
#[cfg(nope)]
{
do yeet //~ ERROR `do yeet` expression is experimental
}
Some(1)
}
#[cfg(nope)]
pub fn alternative() -> Result<(), String> {
do yeet "hello"; //~ ERROR `do yeet` expression is experimental
}
fn main() {
demo();
}