Skip to content

Commit 12d1f86

Browse files
authored
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
2 parents 236e53a + 9617014 commit 12d1f86

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/libsyntax/parse/parser/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ impl<'a> Parser<'a> {
423423
self.struct_span_err(span_of_tilde, "`~` cannot be used as a unary operator")
424424
.span_suggestion_short(
425425
span_of_tilde,
426-
"use `!` to perform bitwise negation",
426+
"use `!` to perform bitwise not",
427427
"!".to_owned(),
428428
Applicability::MachineApplicable
429429
)

src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: `~` cannot be used as a unary operator
22
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:2:13
33
|
44
LL | let x = ~1;
5-
| ^ help: use `!` to perform bitwise negation
5+
| ^ help: use `!` to perform bitwise not
66

77
error: aborting due to previous error
88

0 commit comments

Comments
 (0)