diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2019-10-18 18:15:16 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2019-10-18 18:15:16 +0900 |
| commit | 9617014aa6c1d95bf4f59fc333b10f6b33dbe1ee (patch) | |
| tree | 0fe680d87e3f320a8bd6ed774000c4b50b1cd6ab /src | |
| parent | da59656b3b2e2469d9bdae3c9c9e8cbacdd5e6f6 (diff) | |
| download | rust-9617014aa6c1d95bf4f59fc333b10f6b33dbe1ee.tar.gz rust-9617014aa6c1d95bf4f59fc333b10f6b33dbe1ee.zip | |
Clarify diagnostics when using `~` as a unary op
Diffstat (limited to 'src')
| -rw-r--r-- | src/libsyntax/parse/parser/expr.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs index 273f5a5ffa3..67a530ec683 100644 --- a/src/libsyntax/parse/parser/expr.rs +++ b/src/libsyntax/parse/parser/expr.rs @@ -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 ) diff --git a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr index 84235ca4d63..79bc7d2565b 100644 --- a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr +++ b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr @@ -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 |
