Closed
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)