Skip to content
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

Closed
wants to merge 4 commits into from
Closed

New unreachable! macro. #9988

wants to merge 4 commits into from

Conversation

erdnaxeli
Copy link
Contributor

This fixes #4749.

Copy link
Member

@straight-shoota straight-shoota left a 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...

@asterite
Copy link
Member

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.

@erdnaxeli
Copy link
Contributor Author

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]>
@asterite
Copy link
Member

Yes, and that happened before we had exhaustive checks built into the language. And the general consensus didn't include my approval.

@erdnaxeli
Copy link
Contributor Author

So let's close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: unreachable! method to express unreachable code explicitly
3 participants