Skip to content

Commit 9617014

Browse files
committed
Clarify diagnostics when using ~ as a unary op
1 parent da59656 commit 9617014

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: 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
)

Diff for: 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)