about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorJonathan Brouwer <jonathantbrouwer@gmail.com>2025-05-31 18:34:26 +0200
committerJonathan Brouwer <jonathantbrouwer@gmail.com>2025-05-31 18:34:35 +0200
commitb1a1df2efe0a2d3af7d71566d09d4724a89e039a (patch)
tree7ad669f4bedc464ee1831e4e3f3b6450e0917122 /tests/ui
parenta261d167ac33c8fa9fc5fd46f70f46679fefb5b9 (diff)
downloadrust-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.stderr6
-rw-r--r--tests/ui/typeck/consider-borrowing-141810-2.stderr5
-rw-r--r--tests/ui/typeck/consider-borrowing-141810-3.stderr4
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