-
-
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
New unreachable!
macro.
#9988
New unreachable!
macro.
#9988
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem this really needs to be a macro. Making unreachable!
a method should be fine. It doesn't do anything that needs to happen at compile time.
I'm not sure why Rust's implementation is a macro. But I also don't know how Rust macros work...
In the original issue the problem was that you needed to raise if an enum value wasn't covered. That's not the case anymore if you use "case in". There's really no reason to introduce something that's essentially a very simple raise. And raise is more explicit. People will have to learn about this cryptic unreachable! thing when it's just raising. Let's not merge this. |
It seems to me that the issue conclusion was exactly the opposite 😅 . But I understand. We can then close this PR and the linked issue too. |
Co-authored-by: Johannes Müller <[email protected]>
Yes, and that happened before we had exhaustive checks built into the language. And the general consensus didn't include my approval. |
So let's close it. |
This fixes #4749.