1
Fork 0

Add AsyncFn family of traits

This commit is contained in:
Michael Goulet 2023-12-20 17:41:51 +00:00
parent 71696e516d
commit 0e6f7c6c7c
5 changed files with 134 additions and 1 deletions

View file

@ -0,0 +1,16 @@
// edition: 2021
// check-pass
#![feature(async_fn_traits)]
use std::ops::AsyncFn;
async fn foo() {}
async fn call_asyncly(f: impl AsyncFn(i32) -> i32) -> i32 {
f.async_call((1i32,)).await
}
fn main() {
let fut = call_asyncly(|x| async move { x + 1 });
}