-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.relnotesMarks issues that should be documented in the release notes of the next release.Marks issues that should be documented in the release notes of the next release.
Description
Given the following code:
let _ = &..;
The current output is:
error: expected expression, found `..`
--> src/main.rs:2:14
|
2 | let _ = &..;
| ^^ expected expression
..
is a valid expression (a RangeFull
literal), so this error is misleading. It should at a minimum have a suggestion to replace with the valid version &(..)
, and probably should just work. It also imho ideally shouldn't be a hard parser error blocking semantic passes; the parse of &(..)
is fairly unambiguously intended, even if we decide we should still require the parenthesis.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.relnotesMarks issues that should be documented in the release notes of the next release.Marks issues that should be documented in the release notes of the next release.