]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-98604.rs
Rollup merge of #106732 - durin42:dmitrig-arrayref-ctor, r=nikic
[rust.git] / tests / ui / type-alias-impl-trait / issue-98604.rs
1 // edition:2018
2
3 type AsyncFnPtr = Box<dyn Fn() -> std::pin::Pin<Box<dyn std::future::Future<Output = ()>>>>;
4
5 async fn test() {}
6
7 #[allow(unused_must_use)]
8 fn main() {
9     Box::new(test) as AsyncFnPtr;
10     //~^ 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 = ()>`
11 }