2021-09-13 19:39:30 +02:00
|
|
|
// Regression test for #88653, where a confusing warning about a
|
2023-10-19 21:46:28 +00:00
|
|
|
// type mismatch in coroutine arguments was issued.
|
2021-09-13 19:39:30 +02:00
|
|
|
|
2023-10-19 21:46:28 +00:00
|
|
|
#![feature(coroutines, coroutine_trait)]
|
2021-09-13 19:39:30 +02:00
|
|
|
|
2023-10-19 16:06:43 +00:00
|
|
|
use std::ops::Coroutine;
|
2021-09-13 19:39:30 +02:00
|
|
|
|
2023-10-19 16:06:43 +00:00
|
|
|
fn foo(bar: bool) -> impl Coroutine<(bool,)> {
|
2023-10-19 21:46:28 +00:00
|
|
|
//~^ ERROR: type mismatch in coroutine arguments [E0631]
|
2022-07-28 19:33:10 +04:00
|
|
|
//~| NOTE: expected due to this
|
2023-10-19 21:46:28 +00:00
|
|
|
//~| NOTE: expected coroutine signature `fn((bool,)) -> _`
|
2022-07-28 19:33:10 +04:00
|
|
|
//~| 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`
|
2024-04-11 13:15:34 +00:00
|
|
|
#[coroutine]
|
2022-02-16 15:48:46 +00:00
|
|
|
|bar| {
|
2022-07-28 19:33:10 +04:00
|
|
|
//~^ NOTE: found signature defined here
|
2024-10-25 04:38:48 +00:00
|
|
|
//~| NOTE: return type was inferred to be
|
2021-09-13 19:39:30 +02:00
|
|
|
if bar {
|
|
|
|
yield bar;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|