2024-01-25 11:43:35 -06:00
|
|
|
//@ aux-build:block-on.rs
|
|
|
|
//@ edition:2021
|
|
|
|
//@ build-pass
|
|
|
|
|
2024-02-06 11:41:48 -06:00
|
|
|
#![feature(async_closure)]
|
2024-01-25 11:43:35 -06:00
|
|
|
|
|
|
|
extern crate block_on;
|
|
|
|
|
|
|
|
use std::future::Future;
|
|
|
|
use std::marker::PhantomData;
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
struct B<'b>(PhantomData<&'b mut &'b mut ()>);
|
|
|
|
|
|
|
|
impl S {
|
2024-02-06 11:41:48 -06:00
|
|
|
async fn q<F: async Fn(B<'_>)>(self, f: F) {
|
2024-01-25 11:43:35 -06:00
|
|
|
f(B(PhantomData)).await;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
block_on::block_on(async {
|
|
|
|
S.q(async |b: B<'_>| { println!("...") }).await;
|
|
|
|
});
|
|
|
|
}
|