Error help msg when attempting usage of ~ as unary operator misleading #57239
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-papercut
Diagnostics: An error or lint that needs small tweaks.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I find the error message confusing and possibly incorrect when attempting to use
~
as a unary operator:In current Rust stable and nightly, I get:
The "help" is misleading because it is suggesting using
!
to "perform bitwise negation." But this is not really what ~ performs. NEG and NOT are two separate instructions which perform different things. I think this message would be best changed to "perform bitwise NOT" or "perform bitwise one's complement"The text was updated successfully, but these errors were encountered: