rust/tests/ui/generator/issue-88653.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
651 B
Rust
Raw Normal View History

// 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]
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`
//~| NOTE: in this expansion of desugaring of `impl Trait`
|bar| {
2022-07-28 10:33:10 -05:00
//~^ NOTE: found signature defined here
if bar {
yield bar;
}
}
}
fn main() {}