Rollup merge of #65552 - JohnTitor:use-bitwise-not, r=Dylan-DPC
Clarify diagnostics when using `~` as a unary op It seems we prefer `bitwise not` to `bitwise negation`. Fixes #57239 r? @estebank
This commit is contained in:
commit
3850408b9b
2 changed files with 2 additions and 2 deletions
|
@ -423,7 +423,7 @@ impl<'a> Parser<'a> {
|
|||
self.struct_span_err(span_of_tilde, "`~` cannot be used as a unary operator")
|
||||
.span_suggestion_short(
|
||||
span_of_tilde,
|
||||
"use `!` to perform bitwise negation",
|
||||
"use `!` to perform bitwise not",
|
||||
"!".to_owned(),
|
||||
Applicability::MachineApplicable
|
||||
)
|
||||
|
|
|
@ -2,7 +2,7 @@ error: `~` cannot be used as a unary operator
|
|||
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:2:13
|
||||
|
|
||||
LL | let x = ~1;
|
||||
| ^ help: use `!` to perform bitwise negation
|
||||
| ^ help: use `!` to perform bitwise not
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue