os-rust/tests/ui/coroutine/resume-arg-late-bound.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
467 B
Rust
Raw Normal View History

2023-10-19 21:46:28 +00:00
//! Tests that we cannot produce a coroutine that accepts a resume argument
//! with any lifetime and then stores it across a `yield`.
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
2023-10-19 16:06:43 +00:00
use std::ops::Coroutine;
2023-10-19 16:06:43 +00:00
fn test(a: impl for<'a> Coroutine<&'a mut bool>) {}
fn main() {
let gen = #[coroutine] |arg: &mut bool| {
yield ();
*arg = true;
};
test(gen);
//~^ ERROR implementation of `Coroutine` is not general enough
}