mirror of
https://github.com/rust-lang/rust.git
synced 2026-03-19 11:59:31 +00:00
Error on using yield without also using #[coroutine] on the closure
And suggest adding the `#[coroutine]` to the closure
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
use std::ops::Coroutine;
|
||||
|
||||
fn coroutine_test() -> impl Coroutine<Yield = i32, Return = ()> {
|
||||
|| {
|
||||
#[coroutine] || {
|
||||
yield 0;
|
||||
let s = String::from("foo");
|
||||
yield 1;
|
||||
|
||||
Reference in New Issue
Block a user