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

rustc: leave space for fields of uninhabited types to allow partial initialization. #50622

Merged
merged 1 commit into from
May 13, 2018

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented May 10, 2018

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).

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 10, 2018
@nikomatsakis nikomatsakis added the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 10, 2018
@nikomatsakis
Copy link
Contributor

@bors r+ -- nominating for beta backport too

@bors
Copy link
Contributor

bors commented May 10, 2018

📌 Commit 9235c9f has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 10, 2018
@nikomatsakis
Copy link
Contributor

because of #50442 -- or is there a more targeted fix or something?

@eddyb
Copy link
Member Author

eddyb commented May 11, 2018

@nikomatsakis A more targeted fix without solving the problem of leaving space for fields, would likely lead to an incorrect optimization, because of the Abi::Scalar fields which may not exist.

@bors
Copy link
Contributor

bors commented May 13, 2018

⌛ Testing commit 9235c9f with merge f9ae5bc...

bors added a commit that referenced this pull request May 13, 2018
rustc: leave space for fields of uninhabited types to allow partial initialization.

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).
@bors
Copy link
Contributor

bors commented May 13, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing f9ae5bc to master...

@bors bors merged commit 9235c9f into rust-lang:master May 13, 2018
@alexcrichton alexcrichton added beta-accepted Accepted for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels May 13, 2018
bors added a commit that referenced this pull request May 13, 2018
[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
@eddyb eddyb deleted the make-room-for-ghosts branch May 14, 2018 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants