]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/feature-gate-yeet_expr-in-cfg.rs
parser will not give wrong help message for 'public'
[rust.git] / src / test / ui / feature-gates / feature-gate-yeet_expr-in-cfg.rs
1 // compile-flags: --edition 2021
2
3 pub fn demo() -> Option<i32> {
4     #[cfg(nope)]
5     {
6         do yeet //~ ERROR `do yeet` expression is experimental
7     }
8
9     Some(1)
10 }
11
12 #[cfg(nope)]
13 pub fn alternative() -> Result<(), String> {
14     do yeet "hello"; //~ ERROR `do yeet` expression is experimental
15 }
16
17 fn main() {
18     demo();
19 }