summaryrefslogtreecommitdiffstats
path: root/src/test/ui/did_you_mean
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/did_you_mean')
-rw-r--r--src/test/ui/did_you_mean/bad-assoc-ty.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-31424.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed5
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs5
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr34
-rw-r--r--src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr16
-rw-r--r--src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr10
-rw-r--r--src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr4
-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
10 files changed, 76 insertions, 34 deletions
diff --git a/src/test/ui/did_you_mean/bad-assoc-ty.stderr b/src/test/ui/did_you_mean/bad-assoc-ty.stderr
index 2326af934..21f957ab5 100644
--- a/src/test/ui/did_you_mean/bad-assoc-ty.stderr
+++ b/src/test/ui/did_you_mean/bad-assoc-ty.stderr
@@ -105,9 +105,9 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | type H = Fn(u8) -> (u8)::Output;
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
|
LL | type H = <dyn Fn(u8) -> (u8)>::Output;
diff --git a/src/test/ui/did_you_mean/issue-31424.stderr b/src/test/ui/did_you_mean/issue-31424.stderr
index 886173812..8fe38bf69 100644
--- a/src/test/ui/did_you_mean/issue-31424.stderr
+++ b/src/test/ui/did_you_mean/issue-31424.stderr
@@ -24,8 +24,8 @@ LL | fn bar(self: &mut Self) {
LL | (&mut self).bar();
| ----------------- recursive call site
|
- = note: `#[warn(unconditional_recursion)]` on by default
= help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
--> $DIR/issue-31424.rs:16:9
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 87debfece..e566ed488 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,9 @@
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 015a8edce..1708a8050 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,9 @@
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 84b81d561..2a3242abe 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,37 @@ 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: 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-43871-enum-instead-of-variant.stderr b/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr
index bca493e67..9dde5b3eb 100644
--- a/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr
+++ b/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr
@@ -1,11 +1,3 @@
-error[E0423]: expected function, tuple struct or tuple variant, found enum `Option`
- --> $DIR/issue-43871-enum-instead-of-variant.rs:19:13
- |
-LL | let x = Option(1);
- | ^^^^^^ help: try to construct one of the enum's variants: `std::option::Option::Some`
- |
- = help: you might have meant to construct the enum's non-tuple variant
-
error[E0532]: expected tuple struct or tuple variant, found enum `Option`
--> $DIR/issue-43871-enum-instead-of-variant.rs:21:12
|
@@ -27,6 +19,14 @@ note: the enum is defined here
LL | enum Example { Ex(String), NotEx }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+error[E0423]: expected function, tuple struct or tuple variant, found enum `Option`
+ --> $DIR/issue-43871-enum-instead-of-variant.rs:19:13
+ |
+LL | let x = Option(1);
+ | ^^^^^^ help: try to construct one of the enum's variants: `std::option::Option::Some`
+ |
+ = help: you might have meant to construct the enum's non-tuple variant
+
error[E0423]: expected function, tuple struct or tuple variant, found enum `Void`
--> $DIR/issue-43871-enum-instead-of-variant.rs:31:13
|
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 3ccc14bba..14918ba89 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 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 logical negation
+ | 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 logical negation
+ | ----- help: use `!` to perform logical negation or 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 logical negation or bitwise not
error: aborting due to 6 previous errors
diff --git a/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr b/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
index 26986684f..81f3f2694 100644
--- a/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
+++ b/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
@@ -15,13 +15,13 @@ help: Unicode character '−' (Minus Sign) looks like '-' (Minus/Hyphen), but it
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e-11; // m³⋅kg⁻¹⋅s⁻²
| ~
-error[E0277]: cannot subtract `{integer}` from `{float}`
+error[E0277]: cannot subtract `{integer}` from `{float}` in const contexts
--> $DIR/issue-49746-unicode-confusable-in-float-literal-expt.rs:1:53
|
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹⋅s⁻²
| ^ no implementation for `{float} - {integer}`
|
- = help: the trait `Sub<{integer}>` is not implemented for `{float}`
+ = help: the trait `~const Sub<{integer}>` is not implemented for `{float}`
= help: the following other types implement trait `Sub<Rhs>`:
<&'a f32 as Sub<f32>>
<&'a f64 as Sub<f64>>
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 528c62f50..cbe59e8e0 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 0350890c1..6455b0863 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