]> git.lizzy.rs Git - rust.git/blob - tests/ui/generator/resume-arg-late-bound.rs
Rollup merge of #106701 - ibraheemdev:sync-sender-spin, r=Amanieu
[rust.git] / tests / ui / generator / resume-arg-late-bound.rs
1 //! Tests that we cannot produce a generator that accepts a resume argument
2 //! with any lifetime and then stores it across a `yield`.
3
4 #![feature(generators, generator_trait)]
5
6 use std::ops::Generator;
7
8 fn test(a: impl for<'a> Generator<&'a mut bool>) {}
9
10 fn main() {
11     let gen = |arg: &mut bool| {
12         yield ();
13         *arg = true;
14     };
15     test(gen);
16     //~^ ERROR mismatched types
17 }