Skip to content

missing recover for typo'd const in const parameter definition #111941

Closed
@BoxyUwU

Description

@BoxyUwU

Code

pub fn bar<Const N: u8>() {}

Current output

error: expected one of `,`, `:`, `=`, or `>`, found `N`
 --> src/lib.rs:1:18
  |
1 | pub fn bar<Const N: u8>() {}
  |                  ^ expected one of `,`, `:`, `=`, or `>`

Desired output

It should say that the `const` was typo'd as `Const` and should be `Const` preferably with a `help:` thing that shows the diff (and probably should be auto-fixable?)

Rationale and extra context

No response

Other cases

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsT-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