-
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
Story from here
Given the following code:
fn main() {
let mut i = 0;
i++;
println!("i: {:?}", i);
}
The current output is:
error: Rust has no postfix increment operator
--> ./p/inc.rs:3:6
|
3 | i++;
| ^^ not a valid postfix operator
|
help: use `+= 1` instead
|
3 | { let tmp = i; i += 1; tmp };
| +++++++++++ ~~~~~~~~~~~~~~~
3 | i += 1;
| ~~~~
Ideally the output should look like:
error: Rust has no postfix increment operator
--> ./p/inc.rs:3:6
|
3 | i++;
| ^^ not a valid postfix operator
|
help: use `+= 1` instead
3 | i += 1;
| ~~~~
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.