rust/tests/ui/coroutine/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
2023-10-19 16:46:28 -05:00
// type mismatch in coroutine arguments was issued.
2023-10-19 16:46:28 -05:00
#![feature(coroutines, coroutine_trait)]
2023-10-19 11:06:43 -05:00
use std::ops::Coroutine;
2023-10-19 11:06:43 -05:00
fn foo(bar: bool) -> impl Coroutine<(bool,)> {
2023-10-19 16:46:28 -05:00
//~^ ERROR: type mismatch in coroutine arguments [E0631]
2022-07-28 10:33:10 -05:00
//~| NOTE: expected due to this
2023-10-19 16:46:28 -05:00
//~| NOTE: expected coroutine signature `fn((bool,)) -> _`
2022-07-28 10:33:10 -05:00
//~| 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() {}