2021-09-13 12:39:30 -05:00
|
|
|
// 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.
|
2021-09-13 12:39:30 -05:00
|
|
|
|
2023-10-19 16:46:28 -05:00
|
|
|
#![feature(coroutines, coroutine_trait)]
|
2021-09-13 12:39:30 -05:00
|
|
|
|
2023-10-19 11:06:43 -05:00
|
|
|
use std::ops::Coroutine;
|
2021-09-13 12:39:30 -05:00
|
|
|
|
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`
|
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() {}
|