-
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 lintsT-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.
Description
Given the following code:
fn main() {
let x = +1;
}
The current output is:
error: expected expression, found `+`
--> src/main.rs:2:13
|
2 | let x = +1;
| ^ expected expression
Ideally, if we want to continue rejecting unary plus on number literals, the parser should recover the unexpected unary plus, and the output should look somewhat like:
error: leading `+` on numeric literals is not supported
--> src/main.rs:2:13
|
2 | let x = +1;
| ^ unexpected `+`
= help: remove it; the unsigned literal is positive and may still be used for a signed type
Tested on 1.56.0-nightly (2021-08-22 af14075)
leonardo-m
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
theo-lw commentedon Sep 1, 2021
Working on this @rustbot claim.
Rollup merge of rust-lang#88553 - theo-lw:issue-88276, r=estebank
Auto merge of rust-lang#88750 - jackh726:rollup-w57i9fp, r=jackh726
camelid commentedon Sep 8, 2021
Closing now that #88553 has been merged.