rust/tests/ui/coroutine/borrow-in-tail-expr.rs
Oli Scherer aef0f4024a Error on using yield without also using #[coroutine] on the closure
And suggest adding the `#[coroutine]` to the closure
2024-04-24 08:05:29 +00:00

12 lines
175 B
Rust

//@ run-pass
#![feature(coroutines, stmt_expr_attributes)]
fn main() {
let _a = #[coroutine] || {
yield;
let a = String::new();
a.len()
};
}