Skip to content

2018 edition - confusing error message when declaring unnamed parameters #53990

Description

@EpicatSupercell

This code works correctly on nightly and stable

trait Trait {
    fn func(u8);
}

but not on 2018 edition, where it returns the error

error: expected one of `:` or `@`, found `)`
 --> src/main.rs:2:15
  |
2 |     fn func(u8);
  |               ^ expected one of `:` or `@` here

Changing it to func(_: u8) solves it.

Is this an intended change?
I couldn't find anything about it in the edition guide.

Activity

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

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-frontendArea: Compiler frontend (errors, parsing and HIR)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: Diagnostics

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions