summaryrefslogtreecommitdiffstats
path: root/tests/ui/expr/if
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/expr/if/attrs/bad-cfg.stderr2
-rw-r--r--tests/ui/expr/if/attrs/stmt-expr-gated.stderr2
-rw-r--r--tests/ui/expr/if/bad-if-let-suggestion.rs3
-rw-r--r--tests/ui/expr/if/bad-if-let-suggestion.stderr22
-rw-r--r--tests/ui/expr/if/if-branch-types.stderr2
-rw-r--r--tests/ui/expr/if/if-let-arm-types.stderr2
-rw-r--r--tests/ui/expr/if/if-typeck.stderr2
-rw-r--r--tests/ui/expr/if/if-without-block.stderr2
-rw-r--r--tests/ui/expr/if/if-without-else-result.stderr2
-rw-r--r--tests/ui/expr/if/issue-4201.stderr2
10 files changed, 23 insertions, 18 deletions
diff --git a/tests/ui/expr/if/attrs/bad-cfg.stderr b/tests/ui/expr/if/attrs/bad-cfg.stderr
index 8a2890886..ca0eced26 100644
--- a/tests/ui/expr/if/attrs/bad-cfg.stderr
+++ b/tests/ui/expr/if/attrs/bad-cfg.stderr
@@ -4,5 +4,5 @@ error: removing an expression is not supported in this position
LL | let _ = #[cfg(FALSE)] if true {};
| ^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to 1 previous error
diff --git a/tests/ui/expr/if/attrs/stmt-expr-gated.stderr b/tests/ui/expr/if/attrs/stmt-expr-gated.stderr
index 47dac39a9..afc26757c 100644
--- a/tests/ui/expr/if/attrs/stmt-expr-gated.stderr
+++ b/tests/ui/expr/if/attrs/stmt-expr-gated.stderr
@@ -7,6 +7,6 @@ LL | let _ = #[deny(warnings)] if true {
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/expr/if/bad-if-let-suggestion.rs b/tests/ui/expr/if/bad-if-let-suggestion.rs
index 99d584ac7..b0d0676e1 100644
--- a/tests/ui/expr/if/bad-if-let-suggestion.rs
+++ b/tests/ui/expr/if/bad-if-let-suggestion.rs
@@ -1,6 +1,3 @@
-// FIXME(compiler-errors): This really should suggest `let` on the RHS of the
-// `&&` operator, but that's kinda hard to do because of precedence.
-// Instead, for now we just make sure not to suggest `if let let`.
fn a() {
if let x = 1 && i = 2 {}
//~^ ERROR cannot find value `i` in this scope
diff --git a/tests/ui/expr/if/bad-if-let-suggestion.stderr b/tests/ui/expr/if/bad-if-let-suggestion.stderr
index 20ac9ca76..0d1f895bd 100644
--- a/tests/ui/expr/if/bad-if-let-suggestion.stderr
+++ b/tests/ui/expr/if/bad-if-let-suggestion.stderr
@@ -1,19 +1,27 @@
error: expected expression, found `let` statement
- --> $DIR/bad-if-let-suggestion.rs:5:8
+ --> $DIR/bad-if-let-suggestion.rs:2:8
|
LL | if let x = 1 && i = 2 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
+help: you might have meant to continue the let-chain
+ |
+LL | if let x = 1 && let i = 2 {}
+ | +++
+help: you might have meant to compare for equality
+ |
+LL | if let x = 1 && i == 2 {}
+ | +
error[E0425]: cannot find value `i` in this scope
- --> $DIR/bad-if-let-suggestion.rs:5:21
+ --> $DIR/bad-if-let-suggestion.rs:2:21
|
LL | if let x = 1 && i = 2 {}
| ^ not found in this scope
error[E0425]: cannot find value `i` in this scope
- --> $DIR/bad-if-let-suggestion.rs:12:9
+ --> $DIR/bad-if-let-suggestion.rs:9:9
|
LL | fn a() {
| ------ similarly named function `a` defined here
@@ -22,7 +30,7 @@ LL | if (i + j) = i {}
| ^ help: a function with a similar name exists: `a`
error[E0425]: cannot find value `j` in this scope
- --> $DIR/bad-if-let-suggestion.rs:12:13
+ --> $DIR/bad-if-let-suggestion.rs:9:13
|
LL | fn a() {
| ------ similarly named function `a` defined here
@@ -31,7 +39,7 @@ LL | if (i + j) = i {}
| ^ help: a function with a similar name exists: `a`
error[E0425]: cannot find value `i` in this scope
- --> $DIR/bad-if-let-suggestion.rs:12:18
+ --> $DIR/bad-if-let-suggestion.rs:9:18
|
LL | fn a() {
| ------ similarly named function `a` defined here
@@ -40,7 +48,7 @@ LL | if (i + j) = i {}
| ^ help: a function with a similar name exists: `a`
error[E0425]: cannot find value `x` in this scope
- --> $DIR/bad-if-let-suggestion.rs:19:8
+ --> $DIR/bad-if-let-suggestion.rs:16:8
|
LL | fn a() {
| ------ similarly named function `a` defined here
@@ -49,7 +57,7 @@ LL | if x[0] = 1 {}
| ^ help: a function with a similar name exists: `a`
error[E0308]: mismatched types
- --> $DIR/bad-if-let-suggestion.rs:5:8
+ --> $DIR/bad-if-let-suggestion.rs:2:8
|
LL | if let x = 1 && i = 2 {}
| ^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
diff --git a/tests/ui/expr/if/if-branch-types.stderr b/tests/ui/expr/if/if-branch-types.stderr
index d2bba8821..0e86a24f3 100644
--- a/tests/ui/expr/if/if-branch-types.stderr
+++ b/tests/ui/expr/if/if-branch-types.stderr
@@ -11,6 +11,6 @@ help: change the type of the numeric literal from `u32` to `i32`
LL | let x = if true { 10i32 } else { 10i32 };
| ~~~
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/expr/if/if-let-arm-types.stderr b/tests/ui/expr/if/if-let-arm-types.stderr
index b40a0f479..285f5c4a6 100644
--- a/tests/ui/expr/if/if-let-arm-types.stderr
+++ b/tests/ui/expr/if/if-let-arm-types.stderr
@@ -12,6 +12,6 @@ LL | | 1
LL | | };
| |_____- `if` and `else` have incompatible types
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/expr/if/if-typeck.stderr b/tests/ui/expr/if/if-typeck.stderr
index 74ed0ed0a..1be43a201 100644
--- a/tests/ui/expr/if/if-typeck.stderr
+++ b/tests/ui/expr/if/if-typeck.stderr
@@ -7,6 +7,6 @@ LL | if f { }
= note: expected type `bool`
found fn item `fn() {f}`
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/expr/if/if-without-block.stderr b/tests/ui/expr/if/if-without-block.stderr
index 2d1ee04ce..98bde827a 100644
--- a/tests/ui/expr/if/if-without-block.stderr
+++ b/tests/ui/expr/if/if-without-block.stderr
@@ -10,5 +10,5 @@ help: this binary operation is possibly unfinished
LL | if 5 == {
| ^^^^
-error: aborting due to previous error
+error: aborting due to 1 previous error
diff --git a/tests/ui/expr/if/if-without-else-result.stderr b/tests/ui/expr/if/if-without-else-result.stderr
index 317faf7c6..4eaa03934 100644
--- a/tests/ui/expr/if/if-without-else-result.stderr
+++ b/tests/ui/expr/if/if-without-else-result.stderr
@@ -10,6 +10,6 @@ LL | let a = if true { true };
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0317`.
diff --git a/tests/ui/expr/if/issue-4201.stderr b/tests/ui/expr/if/issue-4201.stderr
index 612fe7764..c761d0b85 100644
--- a/tests/ui/expr/if/issue-4201.stderr
+++ b/tests/ui/expr/if/issue-4201.stderr
@@ -13,6 +13,6 @@ LL | | };
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0317`.