summaryrefslogtreecommitdiffstats
path: root/tests/ui/generator/issue-88653.rs
blob: 1d9377bcef4de4e7b47418731b81d3001cc92746 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Regression test for #88653, where a confusing warning about a
// type mismatch in generator arguments was issued.

#![feature(generators, generator_trait)]

use std::ops::Generator;

fn foo(bar: bool) -> impl Generator<(bool,)> {
    //~^ ERROR: type mismatch in generator arguments [E0631]
    //~| NOTE: expected due to this
    //~| NOTE: expected generator signature `fn((bool,)) -> _`
    //~| NOTE: in this expansion of desugaring of `impl Trait`
    //~| NOTE: in this expansion of desugaring of `impl Trait`
    |bar| {
        //~^ NOTE: found signature defined here
        if bar {
            yield bar;
        }
    }
}

fn main() {}