-
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
fix: Support nested type on replace if let with match #10491
fix: Support nested type on replace if let with match #10491
Conversation
Ideally we will be able to generate exhaustive patterns for any patterns properly(the compilers exhaustiveness checks are currently being lifted out into its own crate which would allow us to properly do this soon), so I do prefer having these special cases in place for now. |
This reverts commit aeee703.
Hmm. Currently I thought it is a good solution.
Looking at this seems to be a solution. |
I made a simple implementation. I hope you will see it! @Veykril |
Ye checking whether a pattern is deeper than one level should be good enough for our usecase here for the time being 👍 |
✌️ k-nasa can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
Why
close: #8690
Now, Replacing if-let with match cant't output exhaustive patterns code.
This was because the
else
conversion used specific types (ex. Option, Result) instead of wildcards.I thought it was more of a problem to generate non-exhaustive patterns than the benefits of using the concrete one.
How about using wildcards in
else
?Is this change policy acceptable?
What
make_else_arm