-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
rustc: leave space for fields of uninhabited types to allow partial initialization. #50622
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ -- nominating for beta backport too |
📌 Commit 9235c9f has been approved by |
because of #50442 -- or is there a more targeted fix or something? |
@nikomatsakis A more targeted fix without solving the problem of leaving space for fields, would likely lead to an incorrect optimization, because of the |
☀️ Test successful - status-appveyor, status-travis |
[beta] Process backports * #50622: rustc: leave space for fields of uninhabited types to allow partial initialization. * #50643: typeck: Fix ICE with struct update syntax r? @alexcrichton
Fixes #49298 by only collapsing uninhabited enum variants, and only if they only have ZST fields.
Fixes #50442 incidentally (@nox's optimization didn't take into account uninhabited variants).