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,)> {
|
|
|
|
|bar| {
|
|
|
|
//~^ NOTE: found signature of `fn(bool) -> _`
|
2022-02-14 16:10:22 +00:00
|
|
|
//~| ERROR: type mismatch in generator arguments [E0631]
|
|
|
|
//~| NOTE: expected signature of `fn((bool,)) -> _`
|
2021-09-13 19:39:30 +02:00
|
|
|
if bar {
|
|
|
|
yield bar;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|