From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/expr/if/bad-if-let-suggestion.stderr | 5 +++++ src/test/ui/expr/if/if-let.stderr | 2 +- src/test/ui/expr/if/if-without-else-result.rs | 2 +- src/test/ui/expr/if/if-without-else-result.stderr | 2 +- src/test/ui/expr/if/issue-4201.rs | 2 +- src/test/ui/expr/if/issue-4201.stderr | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/test/ui/expr/if') diff --git a/src/test/ui/expr/if/bad-if-let-suggestion.stderr b/src/test/ui/expr/if/bad-if-let-suggestion.stderr index 60d286fed..3a53a20b4 100644 --- a/src/test/ui/expr/if/bad-if-let-suggestion.stderr +++ b/src/test/ui/expr/if/bad-if-let-suggestion.stderr @@ -62,6 +62,11 @@ error[E0308]: mismatched types | LL | if let x = 1 && i = 2 {} | ^^^^^^^^^^^^^^^^^^ expected `bool`, found `()` + | +help: you might have meant to compare for equality + | +LL | if let x = 1 && i == 2 {} + | + error: aborting due to 8 previous errors diff --git a/src/test/ui/expr/if/if-let.stderr b/src/test/ui/expr/if/if-let.stderr index 8238b3f0e..c4bba3cb1 100644 --- a/src/test/ui/expr/if/if-let.stderr +++ b/src/test/ui/expr/if/if-let.stderr @@ -9,9 +9,9 @@ LL | | println!("irrefutable pattern"); LL | | }); | |______- in this macro invocation | - = note: `#[warn(irrefutable_let_patterns)]` on by default = note: this pattern will always match, so the `if let` is useless = help: consider replacing the `if let` with a `let` + = note: `#[warn(irrefutable_let_patterns)]` on by default = note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) warning: irrefutable `if let` pattern diff --git a/src/test/ui/expr/if/if-without-else-result.rs b/src/test/ui/expr/if/if-without-else-result.rs index cf84a99e5..95604758a 100644 --- a/src/test/ui/expr/if/if-without-else-result.rs +++ b/src/test/ui/expr/if/if-without-else-result.rs @@ -1,6 +1,6 @@ fn main() { let a = if true { true }; //~^ ERROR `if` may be missing an `else` clause [E0317] - //~| expected `()`, found `bool` + //~| expected `bool`, found `()` println!("{}", a); } diff --git a/src/test/ui/expr/if/if-without-else-result.stderr b/src/test/ui/expr/if/if-without-else-result.stderr index 821635d37..317faf7c6 100644 --- a/src/test/ui/expr/if/if-without-else-result.stderr +++ b/src/test/ui/expr/if/if-without-else-result.stderr @@ -5,7 +5,7 @@ LL | let a = if true { true }; | ^^^^^^^^^^----^^ | | | | | found here - | expected `()`, found `bool` + | expected `bool`, found `()` | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/expr/if/issue-4201.rs b/src/test/ui/expr/if/issue-4201.rs index 1f292229f..59c465b9e 100644 --- a/src/test/ui/expr/if/issue-4201.rs +++ b/src/test/ui/expr/if/issue-4201.rs @@ -3,7 +3,7 @@ fn main() { 0 } else if false { //~^ ERROR `if` may be missing an `else` clause -//~| expected `()`, found integer +//~| expected integer, found `()` 1 }; } diff --git a/src/test/ui/expr/if/issue-4201.stderr b/src/test/ui/expr/if/issue-4201.stderr index bc638ddf5..612fe7764 100644 --- a/src/test/ui/expr/if/issue-4201.stderr +++ b/src/test/ui/expr/if/issue-4201.stderr @@ -8,7 +8,7 @@ LL | | LL | | 1 | | - found here LL | | }; - | |_____^ expected `()`, found integer + | |_____^ expected integer, found `()` | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type -- cgit v1.2.3