]> git.proxmox.com Git - rustc.git/blob - tests/ui/type-alias-impl-trait/issue-98604.rs
New upstream version 1.68.2+dfsg1
[rustc.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 }