-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ICE with zero-arm alt, no matter the type. Also unsafe pointers. #3096
Comments
my opinion: |
erm, actually, my mistake. The second program produces |
I thought more about this. Now I think I was wrong. There are two things that should happen (one of which I think already does):
Basically, The only realistic scenario where this might matter I can come up with is auto-generated code, where it might happen that in some situations an empty enum is produced, probably corresponding to some case in the generated code that can never happen (a protocol state which can never be entered or what have you). In that case, generating a fail is the right to do: it's essentially an assertion failure, "The impossible happened!" |
@nikomatsakis Your point (2) is what the compiler already does (well, it generates a fail with a more specific message). Obviously, (1) needs to be implemented. |
I fixed case (1). Case (3) already behaves correctly (non-exhaustive pattern error), and case (2) gets rejected with a non-copyable error, as @bblum pointed out. If you have another version of case (2) that illustrates what you want, feel free to open a new bug, but I think what I'm checking in is good enough for now. |
Fixed in c0140f5 |
utils: rewrite `count_newlines` using `bytecount::count`
Bump libloading to 0.8
Bump libloading to 0.8
All of the following programs (edit: not the second) produce
'Assertion pats.is_not_empty() failed', src/rustc/middle/check_alt.rs:80
This one should give a nonexhaustive error:
This one should compile and crash at runtime:
and I don't have the slightest idea what this one should do:
Probably related #3037. The code in that bug compiles but it seems like the only zero-arm alt that can compile.
The text was updated successfully, but these errors were encountered: