diff options
Diffstat (limited to 'tests/ui/type-alias-impl-trait/issue-98604.rs')
-rw-r--r-- | tests/ui/type-alias-impl-trait/issue-98604.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/type-alias-impl-trait/issue-98604.rs b/tests/ui/type-alias-impl-trait/issue-98604.rs new file mode 100644 index 000000000..32c2f9ed5 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/issue-98604.rs @@ -0,0 +1,11 @@ +// edition:2018 + +type AsyncFnPtr = Box<dyn Fn() -> std::pin::Pin<Box<dyn std::future::Future<Output = ()>>>>; + +async fn test() {} + +#[allow(unused_must_use)] +fn main() { + Box::new(test) as AsyncFnPtr; + //~^ ERROR expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>` +} |