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

use std::future::Future;

extern crate block_on;
extern crate foreign;

struct NoCopy;

async fn call_once(f: impl AsyncFnOnce()) {
    f().await;
}

fn main() {
    block_on::block_on(async {
        foreign::closure()().await;
        call_once(foreign::closure()).await;
    });
}