Skip to content

Improve error message for .await in 2015 edition #63533

Closed

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

  1. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    C-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.
    on Aug 13, 2019
  2. added
    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically
    and removed
    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically
    on Aug 13, 2019
  3. self-assigned this
    on Aug 13, 2019
  4. est31 commented on Aug 13, 2019

    @est31
    Member

    Part of #61914

  5. added 8 commits that reference this issue on Aug 15, 2019
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