Misleading diagnostic on missing comma #93867
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4f89aeb79b3d5b09db11201a04b0786e
The current output is:
The
:
and=
suggestions are misleading, because this is a generic invocation, not a generic declaration. You cannot, in fact, write a:
or an=
here:When you write a
:
This code:
Produces this output: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=fe71e2beefbe699e32f4d2c91dfb9b4e
When you write an
=
This code:
Produces this output: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4eb1f410e20dd4e36879637261f0d859
The text was updated successfully, but these errors were encountered: