rust/tests/ui/async-await/async-fn/simple.rs

17 lines
251 B
Rust
Raw Normal View History

2023-12-20 17:41:51 +00:00
// edition: 2021
// build-pass
2023-12-20 17:41:51 +00:00
#![feature(async_fn_traits)]
use std::ops::AsyncFn;
async fn foo() {}
async fn call_asyncly(f: impl AsyncFn(i32) -> i32) -> i32 {
f(1).await
2023-12-20 17:41:51 +00:00
}
fn main() {
let fut = call_asyncly(|x| async move { x + 1 });
}