-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace-if-let-with-match assist generates non-exhaustive match #10583
Comments
Duplicate of #8690, can you try the current nightly? |
#10491 only fixed the specific issue there actually, so this one should still be a problem on current nightly. |
I tried cover this case by test, but it passed. k-nasa#1 The phenomenon confuse me. 🤔 |
I just did some investigations. It seems when run this case by test, there is something wrong with types in |
I will try if I can fix this. It seems to be easy. @rustbot claim |
Fixed in #18797 |
Given the following code:
The assist
replace_if_let_with_match
currently generates the following match expression:… which is non-exhaustive leading rustc to emit the error E0004 since it misses the case
Some(_)
. I expected the assist to generate something akin to this:… since I think the assist is meant to map if-lets to semantically equivalent matches. If that's not a requirement, feel free to close this issue.
The text was updated successfully, but these errors were encountered: