2021-09-13 12:39:30 -05:00
|
|
|
// 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,)> {
|
2022-02-16 09:48:46 -06:00
|
|
|
//~^ ERROR: type mismatch in generator arguments [E0631]
|
2022-07-28 10:33:10 -05:00
|
|
|
//~| NOTE: expected due to this
|
|
|
|
//~| NOTE: expected generator signature `fn((bool,)) -> _`
|
|
|
|
//~| NOTE: in this expansion of desugaring of `impl Trait`
|
2022-02-16 09:48:46 -06:00
|
|
|
//~| NOTE: in this expansion of desugaring of `impl Trait`
|
|
|
|
|bar| {
|
2022-07-28 10:33:10 -05:00
|
|
|
//~^ NOTE: found signature defined here
|
2021-09-13 12:39:30 -05:00
|
|
|
if bar {
|
|
|
|
yield bar;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|