Skip to content

Commit

Permalink
Clarify diagnostics when using ~ as a unary op
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Oct 18, 2019
1 parent da59656 commit 9617014
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libsyntax/parse/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9617014

Please sign in to comment.