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

extern crate block_on;

use std::future::Future;
use std::marker::PhantomData;

struct S;
struct B<'b>(PhantomData<&'b mut &'b mut ()>);

impl S {
    async fn q<F: AsyncFn(B<'_>)>(self, f: F) {
        f(B(PhantomData)).await;
    }
}

fn main() {
    block_on::block_on(async {
        S.q(async |b: B<'_>| { println!("...") }).await;
    });
}