-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.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.
Description
Given the following code: link
fn main() {
let x = not 123;
}
The current output is:
Compiling playground v0.0.1 (/playground)
error: unexpected `123` after identifier
--> src/main.rs:2:17
|
2 | let x = not 123;
| ----^^^
| |
| help: use `!` to perform logical negation
error: could not compile `playground` due to previous error
The above phrasing AFAIK should say "bitwise not" instead of "logical negation" as the above literal is not interpreted as a Boolean.
The following shows a slightly different input and output which has the right phrasing: link
fn main() {
let x = ~ 123;
}
Compiling playground v0.0.1 (/playground)
error: `~` cannot be used as a unary operator
--> src/main.rs:2:13
|
2 | let x = ~ 123;
| ^ help: use `!` to perform bitwise not
error: could not compile `playground` due to previous error
Thanks a lot.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.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.