about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed4
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs4
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr26
-rw-r--r--src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr8
-rw-r--r--src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr16
-rw-r--r--src/test/ui/did_you_mean/issue-54109-without-witness.stderr16
6 files changed, 53 insertions, 21 deletions
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 1244b8827ed..e566ed488c9 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
@@ -3,4 +3,8 @@
 fn main() {
     let _x = !1; //~ ERROR cannot be used as a unary operator
     let _y = !1; //~ ERROR unexpected `1` after identifier
+    let _z = !false; //~ ERROR unexpected keyword `false` after identifier
+    let _a = !true; //~ ERROR unexpected keyword `true` after identifier
+    let v = 1 + 2;
+    let _v = !v; //~ ERROR unexpected `v` 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 51cfaaa0ec1..1708a80505d 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
@@ -3,4 +3,8 @@
 fn main() {
     let _x = ~1; //~ ERROR cannot be used as a unary operator
     let _y = not 1; //~ ERROR unexpected `1` after identifier
+    let _z = not false; //~ ERROR unexpected keyword `false` after identifier
+    let _a = not true; //~ ERROR unexpected keyword `true` after identifier
+    let v = 1 + 2;
+    let _v = not v; //~ ERROR unexpected `v` 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 36a6adfa27a..2a3242abea4 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
@@ -12,5 +12,29 @@ LL |     let _y = not 1;
    |              |
    |              help: use `!` to perform bitwise not
 
-error: aborting due to 2 previous errors
+error: unexpected keyword `false` after identifier
+  --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:6:18
+   |
+LL |     let _z = not false;
+   |              ----^^^^^
+   |              |
+   |              help: use `!` to perform logical negation
+
+error: unexpected keyword `true` after identifier
+  --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:7:18
+   |
+LL |     let _a = not true;
+   |              ----^^^^
+   |              |
+   |              help: use `!` to perform logical negation
+
+error: unexpected `v` after identifier
+  --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:9:18
+   |
+LL |     let _v = not v;
+   |              ----^
+   |              |
+   |              help: use `!` to perform logical negation or bitwise not
+
+error: aborting due to 5 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 6657d824cd7..14918ba8953 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 bitwise not
+   |        help: use `!` to perform logical negation or 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 bitwise not
+   |           help: use `!` to perform logical negation or 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 bitwise not
+   |        ----- help: use `!` to perform logical negation or bitwise not
 LL |         println!("Then when?");
    |         ^^^^^^^
 
@@ -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 bitwise not
+   |                       help: use `!` to perform logical negation or bitwise not
 
 error: aborting due to 6 previous errors
 
diff --git a/src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr b/src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr
index 528c62f501e..cbe59e8e0af 100644
--- a/src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr
+++ b/src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr
@@ -4,7 +4,7 @@ error: `and` is not a logical operator
 LL |     let _ = a and b;
    |               ^^^ help: use `&&` to perform logical conjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `and` is not a logical operator
   --> $DIR/issue-54109-and_instead_of_ampersands.rs:9:10
@@ -12,7 +12,7 @@ error: `and` is not a logical operator
 LL |     if a and b {
    |          ^^^ help: use `&&` to perform logical conjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `or` is not a logical operator
   --> $DIR/issue-54109-and_instead_of_ampersands.rs:20:15
@@ -20,7 +20,7 @@ error: `or` is not a logical operator
 LL |     let _ = a or b;
    |               ^^ help: use `||` to perform logical disjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `or` is not a logical operator
   --> $DIR/issue-54109-and_instead_of_ampersands.rs:22:10
@@ -28,7 +28,7 @@ error: `or` is not a logical operator
 LL |     if a or b {
    |          ^^ help: use `||` to perform logical disjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `and` is not a logical operator
   --> $DIR/issue-54109-and_instead_of_ampersands.rs:30:11
@@ -36,7 +36,7 @@ error: `and` is not a logical operator
 LL |     if (a and b) {
    |           ^^^ help: use `&&` to perform logical conjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `or` is not a logical operator
   --> $DIR/issue-54109-and_instead_of_ampersands.rs:38:11
@@ -44,7 +44,7 @@ error: `or` is not a logical operator
 LL |     if (a or b) {
    |           ^^ help: use `||` to perform logical disjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `and` is not a logical operator
   --> $DIR/issue-54109-and_instead_of_ampersands.rs:46:13
@@ -52,7 +52,7 @@ error: `and` is not a logical operator
 LL |     while a and b {
    |             ^^^ help: use `&&` to perform logical conjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `or` is not a logical operator
   --> $DIR/issue-54109-and_instead_of_ampersands.rs:54:13
@@ -60,7 +60,7 @@ error: `or` is not a logical operator
 LL |     while a or b {
    |             ^^ help: use `||` to perform logical disjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error[E0308]: mismatched types
   --> $DIR/issue-54109-and_instead_of_ampersands.rs:13:33
diff --git a/src/test/ui/did_you_mean/issue-54109-without-witness.stderr b/src/test/ui/did_you_mean/issue-54109-without-witness.stderr
index 0350890c1fd..6455b0863f8 100644
--- a/src/test/ui/did_you_mean/issue-54109-without-witness.stderr
+++ b/src/test/ui/did_you_mean/issue-54109-without-witness.stderr
@@ -4,7 +4,7 @@ error: `and` is not a logical operator
 LL |     let _ = a and b;
    |               ^^^ help: use `&&` to perform logical conjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `and` is not a logical operator
   --> $DIR/issue-54109-without-witness.rs:15:10
@@ -12,7 +12,7 @@ error: `and` is not a logical operator
 LL |     if a and b {
    |          ^^^ help: use `&&` to perform logical conjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `or` is not a logical operator
   --> $DIR/issue-54109-without-witness.rs:24:15
@@ -20,7 +20,7 @@ error: `or` is not a logical operator
 LL |     let _ = a or b;
    |               ^^ help: use `||` to perform logical disjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `or` is not a logical operator
   --> $DIR/issue-54109-without-witness.rs:26:10
@@ -28,7 +28,7 @@ error: `or` is not a logical operator
 LL |     if a or b {
    |          ^^ help: use `||` to perform logical disjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `and` is not a logical operator
   --> $DIR/issue-54109-without-witness.rs:34:11
@@ -36,7 +36,7 @@ error: `and` is not a logical operator
 LL |     if (a and b) {
    |           ^^^ help: use `&&` to perform logical conjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `or` is not a logical operator
   --> $DIR/issue-54109-without-witness.rs:42:11
@@ -44,7 +44,7 @@ error: `or` is not a logical operator
 LL |     if (a or b) {
    |           ^^ help: use `||` to perform logical disjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `and` is not a logical operator
   --> $DIR/issue-54109-without-witness.rs:50:13
@@ -52,7 +52,7 @@ error: `and` is not a logical operator
 LL |     while a and b {
    |             ^^^ help: use `&&` to perform logical conjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: `or` is not a logical operator
   --> $DIR/issue-54109-without-witness.rs:58:13
@@ -60,7 +60,7 @@ error: `or` is not a logical operator
 LL |     while a or b {
    |             ^^ help: use `||` to perform logical disjunction
    |
-   = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+   = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
 
 error: aborting due to 8 previous errors