Skip to content

Improve error message for .await in 2015 edition #63533

Description

@comex

Trivial example:

fn f(x: std::pin::Pin<&mut dyn std::future::Future<Output=()>>) {
    x.await;
}

Output on current nightly:

error[E0609]: no field `await` on type `std::pin::Pin<&mut dyn std::future::Future<Output = ()>>`
 --> src/lib.rs:2:7
  |
2 |     x.await;
  |       ^^^^^ unknown field

Ideally the error message would suggest using the 2018 edition.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-async-awaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsA-type-systemArea: Type systemC-enhancementCategory: 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.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions