about summary refs log tree commit diff
path: root/tests/ui/async-await/async-fn/simple.rs
blob: 89b68e12435c900946387cd645f7787c9698ba7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ aux-build:block-on.rs
//@ edition: 2021
//@ build-pass

extern crate block_on;

use std::ops::AsyncFn;

async fn foo() {}

async fn call_asyncly(f: impl AsyncFn(i32) -> i32) -> i32 {
    f(1).await
}

fn main() {
    block_on::block_on(async {
        call_asyncly(|x| async move { x + 1 }).await;
    });
}