summaryrefslogtreecommitdiffstats
path: root/src/test/ui/feature-gates/feature-gate-yeet_expr-in-cfg.rs
blob: a33bd34508c5f63401fefcc530a672bd56a24371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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();
}