2024-04-11 13:15:34 +00:00
|
|
|
error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
|
|
|
|
--> $DIR/yield-in-function.rs:3:13
|
|
|
|
|
|
|
|
|
LL | fn main() { yield; }
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
help: use `#[coroutine]` to make this closure a coroutine
|
|
|
|
|
|
|
|
|
LL | #[coroutine] fn main() { yield; }
|
|
|
|
| ++++++++++++
|
|
|
|
|
2023-10-19 21:46:28 +00:00
|
|
|
error[E0627]: yield expression outside of coroutine literal
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/yield-in-function.rs:3:13
|
2017-08-09 23:37:56 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | fn main() { yield; }
|
2017-08-09 23:37:56 +00:00
|
|
|
| ^^^^^
|
|
|
|
|
2024-04-11 13:15:34 +00:00
|
|
|
error: aborting due to 2 previous errors
|
2017-08-09 23:37:56 +00:00
|
|
|
|
2019-12-23 13:07:13 +00:00
|
|
|
For more information about this error, try `rustc --explain E0627`.
|