Misleading error message on associated type bounds #87493
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
C-bug
Category: This is a bug.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=adddc330eab816444616202cc576f88e
I expected to see this happen: The error message should indicate that the
==
should be a single=
.Instead, this happened: The error message gives no hint of the correct syntax. It gives two errors, neither of which are helpful:
This error is unhelpful because it says "expected one of
,
or>
", but=
is also allowed. Also, the suggestion to use curly braces is a red herring.This error is unhelpful because I am not specifying const arguments; I'm specifying associated types.
Meta
Rust version according to play.rust-lang.org: 1.53.0
The text was updated successfully, but these errors were encountered: