summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-alias-impl-trait/issue-98604.rs
blob: 32c2f9ed51edf3476df927c63f6465635a7946a0 (plain)
1
2
3
4
5
6
7
8
9
10
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 = ()>`
}