From 3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:43 +0200 Subject: Merging upstream version 1.69.0+dfsg1. Signed-off-by: Daniel Baumann --- .../disallowed-positions.stderr | 46 +++++++++++----------- ...t-else-does-not-interact-with-let-chains.stderr | 13 ++++-- 2 files changed, 32 insertions(+), 27 deletions(-) (limited to 'tests/ui/rfc-2497-if-let-chains') diff --git a/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index 3028f8dbd..81933173c 100644 --- a/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -1516,7 +1516,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:157:8 | LL | if true..(let 0 = 0) {} - | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1525,7 +1525,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:161:8 | LL | if ..(let 0 = 0) {} - | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo` + | ^^^^^^^^^^^^^ expected `bool`, found `RangeTo` | = note: expected type `bool` found struct `RangeTo` @@ -1534,7 +1534,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:165:8 | LL | if (let 0 = 0).. {} - | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom` + | ^^^^^^^^^^^^^ expected `bool`, found `RangeFrom` | = note: expected type `bool` found struct `RangeFrom` @@ -1545,7 +1545,7 @@ error[E0308]: mismatched types LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1554,7 +1554,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:171:8 | LL | if let Range { start: _, end: _ } = true..true && false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1565,7 +1565,7 @@ error[E0308]: mismatched types LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1574,7 +1574,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:175:8 | LL | if let Range { start: _, end: _ } = true..true || false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1585,7 +1585,7 @@ error[E0308]: mismatched types LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool` | | - | expected fn pointer, found struct `Range` + | expected fn pointer, found `Range<_>` | = note: expected fn pointer `fn() -> bool` found struct `std::ops::Range<_>` @@ -1607,7 +1607,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:182:8 | LL | if let Range { start: F, end } = F..|| true {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1618,7 +1618,7 @@ error[E0308]: mismatched types LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1639,7 +1639,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:190:8 | LL | if let Range { start: true, end } = t..&&false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1710,7 +1710,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:249:11 | LL | while true..(let 0 = 0) {} - | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1719,7 +1719,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:253:11 | LL | while ..(let 0 = 0) {} - | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo` + | ^^^^^^^^^^^^^ expected `bool`, found `RangeTo` | = note: expected type `bool` found struct `RangeTo` @@ -1728,7 +1728,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:257:11 | LL | while (let 0 = 0).. {} - | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom` + | ^^^^^^^^^^^^^ expected `bool`, found `RangeFrom` | = note: expected type `bool` found struct `RangeFrom` @@ -1739,7 +1739,7 @@ error[E0308]: mismatched types LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1748,7 +1748,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:263:11 | LL | while let Range { start: _, end: _ } = true..true && false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1759,7 +1759,7 @@ error[E0308]: mismatched types LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1768,7 +1768,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:267:11 | LL | while let Range { start: _, end: _ } = true..true || false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1779,7 +1779,7 @@ error[E0308]: mismatched types LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool` | | - | expected fn pointer, found struct `Range` + | expected fn pointer, found `Range<_>` | = note: expected fn pointer `fn() -> bool` found struct `std::ops::Range<_>` @@ -1801,7 +1801,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:274:11 | LL | while let Range { start: F, end } = F..|| true {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1812,7 +1812,7 @@ error[E0308]: mismatched types LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -1833,7 +1833,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:282:11 | LL | while let Range { start: true, end } = t..&&false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -1883,7 +1883,7 @@ error[E0308]: mismatched types LL | (let Range { start: _, end: _ } = true..true || false); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` | | - | expected `bool`, found struct `Range` + | expected `bool`, found `Range<_>` | = note: expected type `bool` found struct `std::ops::Range<_>` diff --git a/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr b/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr index 498a112fa..9bc3e7541 100644 --- a/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr +++ b/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr @@ -37,6 +37,11 @@ help: add a block here | LL | if let Some(n) = opt else { | ^ +help: remove the `if` if you meant to write a `let...else` statement + | +LL - if let Some(n) = opt else { +LL + let Some(n) = opt else { + | error: this `if` expression is missing a block after the condition --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:28:5 @@ -101,7 +106,7 @@ error[E0308]: mismatched types --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:19 | LL | let Some(n) = opt && n == 1 else { - | ^^^ expected `bool`, found enum `Option` + | ^^^ expected `bool`, found `Option` | = note: expected type `bool` found enum `Option` @@ -112,7 +117,7 @@ error[E0308]: mismatched types LL | let Some(n) = opt && n == 1 else { | ^^^^^^^ ------------- this expression has type `bool` | | - | expected `bool`, found enum `Option` + | expected `bool`, found `Option<_>` | = note: expected type `bool` found enum `Option<_>` @@ -121,7 +126,7 @@ error[E0308]: mismatched types --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19 | LL | let Some(n) = opt && let another = n else { - | ^^^ expected `bool`, found enum `Option` + | ^^^ expected `bool`, found `Option` | = note: expected type `bool` found enum `Option` @@ -132,7 +137,7 @@ error[E0308]: mismatched types LL | let Some(n) = opt && let another = n else { | ^^^^^^^ ---------------------- this expression has type `bool` | | - | expected `bool`, found enum `Option` + | expected `bool`, found `Option<_>` | = note: expected type `bool` found enum `Option<_>` -- cgit v1.2.3