A yield clause was used in an async context.
Erroneous code example:
#![feature(coroutines, stmt_expr_attributes)]
fn main() {
let coroutine = #[coroutine] || {
async {
yield;
}
};
} Here, the yield keyword is used in an async block, which is not yet supported.
To fix this error, you have to move yield out of the async block:
#![feature(coroutines, stmt_expr_attributes)]
fn main() {
let coroutine = #[coroutine] || {
yield;
};
}
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0727.html