Skip to content

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
Contributor

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
Collaborator

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
Collaborator

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
Collaborator

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