rust/tests/ui/coroutine/check-resume-ty-lifetimes.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

12 lines
397 B
Plaintext

error: lifetime may not live long enough
--> $DIR/check-resume-ty-lifetimes.rs:15:20
|
LL | fn mk_static(s: &str) -> &'static str {
| - let's call the lifetime of this reference `'1`
...
LL | let x: &'static str = yield ();
| ^^^^^^^^^^^^ type annotation requires that `'1` must outlive `'static`
error: aborting due to 1 previous error