Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Slight refinement to wording of help suggestion as a result of not being used #101793

Closed
Rageking8 opened this issue Sep 14, 2022 · 2 comments · Fixed by #101846
Closed

Slight refinement to wording of help suggestion as a result of not being used #101793

Rageking8 opened this issue Sep 14, 2022 · 2 comments · Fixed by #101846
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Rageking8
Copy link
Contributor

Rageking8 commented Sep 14, 2022

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.

@Rageking8 Rageking8 added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 14, 2022
@Rageking8
Copy link
Contributor Author

@rustbot label +D-papercut

@rustbot rustbot added the D-papercut Diagnostics: An error or lint that needs small tweaks. label Sep 14, 2022
@chenyukang
Copy link
Member

@rustbot claim

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants