Skip to content

Recover from impl Trait in type param bound #102182

Closed
@estebank

Description

When writing fn foo<T: impl Trait>() {} the current error is "expected one of these tokens", without any attempt to recover the parse. It should instead be closer to:

error[E0404]: expected trait, found struct `S`
 --> src/lib.rs:2:11
  |
2 | fn foo<T: S>() {}
  |           ^ not a trait

Activity

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

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The parsing of Rust source code to an ASTD-papercutDiagnostics: An error or lint that needs small tweaks.P-lowLow priorityT-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