- Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Centril, heckad, estebank, cramertj, scottmcm and 4 more
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Status
Done