Closed
Description
A common problem when using async-await is to forget to invoke .await
. This often shows up as a type error, e.g. in a case like this (playground):
#![feature(async_await)]
async fn make_u32() -> u32 {
22
}
fn take_u32(x: u32) {
}
async fn foo() {
let x = make_u32();
take_u32(x);
}
fn main() { }
currently we give a rather generic error:
error[E0308]: mismatched types
--> src/main.rs:13:14
|
13 | take_u32(x);
| ^ expected u32, found opaque type
|
= note: expected type `u32`
found type `impl std::future::Future`
it'd be nice if we could suggest adding .await
somewhere.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done