diff options
| author | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-05-31 18:34:26 +0200 |
|---|---|---|
| committer | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-05-31 18:34:35 +0200 |
| commit | b1a1df2efe0a2d3af7d71566d09d4724a89e039a (patch) | |
| tree | 7ad669f4bedc464ee1831e4e3f3b6450e0917122 /tests/ui | |
| parent | a261d167ac33c8fa9fc5fd46f70f46679fefb5b9 (diff) | |
| download | rust-b1a1df2efe0a2d3af7d71566d09d4724a89e039a.tar.gz rust-b1a1df2efe0a2d3af7d71566d09d4724a89e039a.zip | |
Fix consider borrowing for else-if
Diffstat (limited to 'tests/ui')
| -rw-r--r-- | tests/ui/typeck/consider-borrowing-141810-1.stderr | 6 | ||||
| -rw-r--r-- | tests/ui/typeck/consider-borrowing-141810-2.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/typeck/consider-borrowing-141810-3.stderr | 4 |
3 files changed, 4 insertions, 11 deletions
diff --git a/tests/ui/typeck/consider-borrowing-141810-1.stderr b/tests/ui/typeck/consider-borrowing-141810-1.stderr index 3cb5d23d3a7..9291721ac71 100644 --- a/tests/ui/typeck/consider-borrowing-141810-1.stderr +++ b/tests/ui/typeck/consider-borrowing-141810-1.stderr @@ -18,8 +18,10 @@ LL | || }; | help: consider borrowing here | -LL | } else &if false { - | + +LL ~ &true +LL | } else { +LL ~ &true + | error: aborting due to 1 previous error diff --git a/tests/ui/typeck/consider-borrowing-141810-2.stderr b/tests/ui/typeck/consider-borrowing-141810-2.stderr index b00384d2d5a..dd229897283 100644 --- a/tests/ui/typeck/consider-borrowing-141810-2.stderr +++ b/tests/ui/typeck/consider-borrowing-141810-2.stderr @@ -13,11 +13,6 @@ LL | || }; | ||_____| | |_____`if` and `else` have incompatible types | expected `&()`, found `()` - | -help: consider borrowing here - | -LL | } else &if false { - | + error: aborting due to 1 previous error diff --git a/tests/ui/typeck/consider-borrowing-141810-3.stderr b/tests/ui/typeck/consider-borrowing-141810-3.stderr index f33920d1325..0b0c5f191a0 100644 --- a/tests/ui/typeck/consider-borrowing-141810-3.stderr +++ b/tests/ui/typeck/consider-borrowing-141810-3.stderr @@ -16,10 +16,6 @@ LL | || }; | = note: `if` expressions without `else` evaluate to `()` = note: consider adding an `else` block that evaluates to the expected type -help: consider borrowing here - | -LL | } else &if false { - | + error: aborting due to 1 previous error |
