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

#![feature(coroutines, coroutine_trait)]

use std::ops::Coroutine;

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

fn main() {}