about summary refs log tree commit diff
path: root/tests/ui/empty
diff options
context:
space:
mode:
authormejrs <>2022-12-23 22:23:37 +0100
committerDavid Tolnay <dtolnay@gmail.com>2023-01-11 14:40:07 -0800
commit8476c517c08c21d770a80d4bf0fea28834ae45f0 (patch)
treedba7dc75bf459d24716351c6158e84730f6686ff /tests/ui/empty
parent31c20210b9683f983953e1a4e45db94146b3c7cb (diff)
downloadrust-8476c517c08c21d770a80d4bf0fea28834ae45f0.tar.gz
rust-8476c517c08c21d770a80d4bf0fea28834ae45f0.zip
Don't recommend `if let` if `let else` works
Diffstat (limited to 'tests/ui/empty')
-rw-r--r--tests/ui/empty/empty-never-array.stderr6
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/ui/empty/empty-never-array.stderr b/tests/ui/empty/empty-never-array.stderr
index 9385382f860..a488e484b2b 100644
--- a/tests/ui/empty/empty-never-array.stderr
+++ b/tests/ui/empty/empty-never-array.stderr
@@ -14,11 +14,7 @@ LL | enum Helper<T, U> {
 LL |     T(T, [!; 0]),
    |     - not covered
    = note: the matched value is of type `Helper<T, U>`
-help: you might want to use `if let` to ignore the variant that isn't matched
-   |
-LL |     let u = if let Helper::U(u) = Helper::T(t, []) { u } else { todo!() };
-   |     ++++++++++                                     ++++++++++++++++++++++
-help: alternatively, you might want to use `let else` to handle the variant that isn't matched
+help: you might want to use `let else` to handle the variant that isn't matched
    |
 LL |     let Helper::U(u) = Helper::T(t, []) else { todo!() };
    |                                         ++++++++++++++++