]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/resume-arg-late-bound.rs
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / 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 }