Closed
Description
async fn _async_bar() -> u32 {
let async_closure = async || {
22_u32
};
async_closure.await
}
Obviously async_closure().await
was what I should have written. It would be great if rustc suggested that maybe I shoudl try calling the closure rather than the error it currently offers:
error[E0277]: the trait bound `[closure@src/main.rs:6:25: 8:6]: std::future::Future` is not satisfied
--> src/main.rs:10:5
|
10 | async_closure.await
| ^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@src/main.rs:6:25: 8:6]`