]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/issue-88653.rs
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / ui / generator / issue-88653.rs
1 // Regression test for #88653, where a confusing warning about a
2 // type mismatch in generator arguments was issued.
3
4 #![feature(generators, generator_trait)]
5
6 use std::ops::Generator;
7
8 fn foo(bar: bool) -> impl Generator<(bool,)> {
9     //~^ ERROR: type mismatch in generator arguments [E0631]
10     //~| NOTE: expected due to this
11     //~| NOTE: expected generator signature `fn((bool,)) -> _`
12     //~| NOTE: in this expansion of desugaring of `impl Trait`
13     //~| NOTE: in this expansion of desugaring of `impl Trait`
14     |bar| {
15         //~^ NOTE: found signature defined here
16         if bar {
17             yield bar;
18         }
19     }
20 }
21
22 fn main() {}