rust/tests/ui/coroutine/yield-in-const.stderr
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

16 lines
464 B
Plaintext

error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
--> $DIR/yield-in-const.rs:3:17
|
LL | const A: u8 = { yield 3u8; 3u8};
| ^^^^^^^^^
error[E0627]: yield expression outside of coroutine literal
--> $DIR/yield-in-const.rs:3:17
|
LL | const A: u8 = { yield 3u8; 3u8};
| ^^^^^^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0627`.