diff options
Diffstat (limited to 'tests/ui/coroutine/issue-88653.rs')
-rw-r--r-- | tests/ui/coroutine/issue-88653.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/coroutine/issue-88653.rs b/tests/ui/coroutine/issue-88653.rs new file mode 100644 index 000000000..ec4c20547 --- /dev/null +++ b/tests/ui/coroutine/issue-88653.rs @@ -0,0 +1,22 @@ +// Regression test for #88653, where a confusing warning about a +// type mismatch in coroutine arguments was issued. + +#![feature(coroutines, coroutine_trait)] + +use std::ops::Coroutine; + +fn foo(bar: bool) -> impl Coroutine<(bool,)> { + //~^ ERROR: type mismatch in coroutine arguments [E0631] + //~| NOTE: expected due to this + //~| NOTE: expected coroutine signature `fn((bool,)) -> _` + //~| NOTE: in this expansion of desugaring of `impl Trait` + //~| NOTE: in this expansion of desugaring of `impl Trait` + |bar| { + //~^ NOTE: found signature defined here + if bar { + yield bar; + } + } +} + +fn main() {} |