about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_error_messages/locales/en-US/parser.ftl2
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed1
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs1
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr10
-rw-r--r--src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr10
5 files changed, 17 insertions, 7 deletions
diff --git a/compiler/rustc_error_messages/locales/en-US/parser.ftl b/compiler/rustc_error_messages/locales/en-US/parser.ftl
index f74df3d9746..b4636eee256 100644
--- a/compiler/rustc_error_messages/locales/en-US/parser.ftl
+++ b/compiler/rustc_error_messages/locales/en-US/parser.ftl
@@ -55,7 +55,7 @@ parser_tilde_is_not_unary_operator = `~` cannot be used as a unary operator
     .suggestion = use `!` to perform bitwise not
 
 parser_unexpected_token_after_not = unexpected {$negated_desc} after identifier
-    .suggestion = use `!` to perform logical negation
+    .suggestion = use `!` to perform bitwise not
 
 parser_malformed_loop_label = malformed loop label
     .suggestion = use the correct loop label format
diff --git a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed
index 87debfeceaa..1244b8827ed 100644
--- a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed
+++ b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed
@@ -2,4 +2,5 @@
 
 fn main() {
     let _x = !1; //~ ERROR cannot be used as a unary operator
+    let _y = !1; //~ ERROR unexpected `1` after identifier
 }
diff --git a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs
index 015a8edcea3..51cfaaa0ec1 100644
--- a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs
+++ b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs
@@ -2,4 +2,5 @@
 
 fn main() {
     let _x = ~1; //~ ERROR cannot be used as a unary operator
+    let _y = not 1; //~ ERROR unexpected `1` after identifier
 }
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 84b81d561e9..36a6adfa27a 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
@@ -4,5 +4,13 @@ error: `~` cannot be used as a unary operator
 LL |     let _x = ~1;
    |              ^ help: use `!` to perform bitwise not
 
-error: aborting due to previous error
+error: unexpected `1` after identifier
+  --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:5:18
+   |
+LL |     let _y = not 1;
+   |              ----^
+   |              |
+   |              help: use `!` to perform bitwise not
+
+error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr b/src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr
index 3ccc14bba54..6657d824cd7 100644
--- a/src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr
+++ b/src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr
@@ -4,7 +4,7 @@ error: unexpected `for_you` after identifier
 LL |     if not for_you {
    |        ----^^^^^^^
    |        |
-   |        help: use `!` to perform logical negation
+   |        help: use `!` to perform bitwise not
 
 error: unexpected `the_worst` after identifier
   --> $DIR/issue-46836-identifier-not-instead-of-negation.rs:11:15
@@ -12,13 +12,13 @@ error: unexpected `the_worst` after identifier
 LL |     while not the_worst {
    |           ----^^^^^^^^^
    |           |
-   |           help: use `!` to perform logical negation
+   |           help: use `!` to perform bitwise not
 
 error: unexpected `println` after identifier
   --> $DIR/issue-46836-identifier-not-instead-of-negation.rs:20:9
    |
 LL |     if not  // lack of braces is [sic]
-   |        ----- help: use `!` to perform logical negation
+   |        ----- help: use `!` to perform bitwise not
 LL |         println!("Then when?");
    |         ^^^^^^^
 
@@ -42,7 +42,7 @@ error: unexpected `2` after identifier
 LL |     let resource = not 2;
    |                    ----^
    |                    |
-   |                    help: use `!` to perform logical negation
+   |                    help: use `!` to perform bitwise not
 
 error: unexpected `be_smothered_out_before` after identifier
   --> $DIR/issue-46836-identifier-not-instead-of-negation.rs:32:27
@@ -50,7 +50,7 @@ error: unexpected `be_smothered_out_before` after identifier
 LL |     let young_souls = not be_smothered_out_before;
    |                       ----^^^^^^^^^^^^^^^^^^^^^^^
    |                       |
-   |                       help: use `!` to perform logical negation
+   |                       help: use `!` to perform bitwise not
 
 error: aborting due to 6 previous errors