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