-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix ICE related to enum struct variants #19568
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
Conversation
0c5a072
to
75c43cd
Compare
That seems good. To do the cross-crate things you can use the aux building functionality. The implementation seems reasonable, but I'm no expert. |
75c43cd
to
651007d
Compare
@alexcrichton Oops! Sorry, I was still thinking of a better method to handle this. Could you r- for now? After I get some confidence, I will remove the [WIP] tag and ask you to merge. If r- doesn't work due to the bot bug, (I heard from somewhere that there was a bug in the bot) please close this PR and I will open another PR again. |
Oh oops, sorry for jumping the gun @barosl! Feel free to |
651007d
to
3ec80ad
Compare
I tried to introduce a cleaner code, but I'm not sure if it worked... By the way, I found a regression that was caused by this PR. Some compiler error messages are somewhat incorrectly displayed.
I'm investigating this issue. |
}) | ||
.collect(); | ||
|
||
(None, arg_tys, Some(arg_names)) |
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.
@barosl if arg_names
is length 0 should you return None
instead of Some(arg_names)
-- maybe that will fix your issue w/ the empty brackets printing in diagnostic message E0004
for nullary enums?
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.
Yeah, that's what I've done in the local repository. It seems to pass the tests, but I'm still a bit concerned if there are more edge cases, such as one or more unnamed fields. Maybe that cannot happen?
Fixes the first case of rust-lang#19340.
Fixes the second case of rust-lang#19340.
3ec80ad
to
086c949
Compare
…ichton This pull request tries to fix #19340, which states two ICE cases related to enum struct variants. It is my first attempt to fix the compiler. I found this solution by trial and error, so the method used to fix the issue looks very hacky. Please review it, and direct me to find a better solution. I'm also to add test cases. Where should I put them? Maybe `src/test/run-pass/issue-19340.rs`?
…editor refactor: editor for `destructure_struct_binding`
This pull request tries to fix #19340, which states two ICE cases related to enum struct variants.
It is my first attempt to fix the compiler. I found this solution by trial and error, so the method used to fix the issue looks very hacky. Please review it, and direct me to find a better solution.
I'm also to add test cases. Where should I put them? Maybe
src/test/run-pass/issue-19340.rs
?