Recover from accidental usage of let
in struct definition
#101683
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: link
The current output is:
Since normal variable declaration are done using a
let
or other keywords in front and I accidentally made that typo due to muscle memory from creating regular variables. I think the ideal output for such a typo will be to suggest removing thelet
and having a small note stating thatlet
is not required for struct variable declarations. (Note: the small note can be omitted if not necessary). This may be useful for beginners first getting used to the language's syntax.The text was updated successfully, but these errors were encountered: