Skip to content

Poor diagnostic for impl for T #56031

Closed
Closed
@Ravenslofty

Description

@Ravenslofty

I accidentally typed impl for T instead of impl T, and the diagnostic (playground) wasn't very helpful:

  |
3 | impl for T {}
  |          ^ expected `<` here

This appears to be because of this syntax:

impl for<'a> T

However it makes no sense in this case. Perhaps better diagnostics would look something like this:

  |
3 | impl for T {}
  |     ^ expected type

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions