Skip to content

Mention editions when emitting 2015 exclusive errors #61914

Open
@estebank

Description

@estebank

The difference between edition defaults for new projects between cargo and rustc can lead to confusion, particularly for newcomers. All errors that would only happen on one edition should mention the discrepancy. We made an effort to have lints for 2015 to 2018 migration, but we were more lax on clarifying diagnostics when following 2018 guides when rustc is ran under 2015. Things like nll discrepancies (seen in #61855, moot point once we enable nll in 2015) come to mind, while things like let async = 6; (pass in 2015, "error: expected pattern, found reserved keyword async" without any mention of editions in 2018) which do not mention editions at all (it should recommend using r#raw_idents always, explain it was accepted in 2015 edition but it's being run in 2018).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.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.WG-epochWorking group: Epoch (2018) management

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions