mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
18 lines
397 B
Rust
18 lines
397 B
Rust
//! Tests that we cannot produce a generator that accepts a resume argument
|
|
//! with any lifetime and then stores it across a `yield`.
|
|
|
|
#![feature(generators, generator_trait)]
|
|
|
|
use std::ops::Generator;
|
|
|
|
fn test(a: impl for<'a> Generator<&'a mut bool>) {}
|
|
|
|
fn main() {
|
|
let gen = |arg: &mut bool| {
|
|
yield ();
|
|
*arg = true;
|
|
};
|
|
test(gen);
|
|
//~^ ERROR mismatched types
|
|
}
|