-
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: ensure optimized enums have a properly aligned size. #46808
Conversation
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
eb5a474
to
b67bf2e
Compare
@bors r+ |
📌 Commit b67bf2e has been approved by |
b67bf2e
to
087f1c2
Compare
I've redone the test such that it fails (on beta & nightly) even without the ICE from #46623. |
@bors r+ |
📌 Commit 087f1c2 has been approved by |
@bors p=1 This needs to get into beta |
rustc: ensure optimized enums have a properly aligned size. Fixes #46769 by padding the optimized enums wrapping packed data as necessary. Note that this is not the only way to solve this - on nightly, #46436 makes it easier to fix without adding new padding because of the replacement of `packed` flags with a non-redundant scheme. But because it can't be backported, the optimal fix will be in a separate nightly-only PR (#46809).
☀️ Test successful - status-appveyor, status-travis |
rustc: do not raise the alignment of optimized enums to the niche's alignment. This is the improved fix for rust-lang#46769 that does not increase the size of any types (see also rust-lang#46808).
Looks like we forgot to backport for 1.23.0 (sorry about that!) so removing the beta tags. |
@alexcrichton #45225 was backed out from that beta (IIUC) so there wasn't anything to backport. |
Ah ok, great! |
Fixes #46769 by padding the optimized enums wrapping packed data as necessary.
Note that this is not the only way to solve this - on nightly, #46436 makes it easier to fix without adding new padding because of the replacement of
packed
flags with a non-redundant scheme.But because it can't be backported, the optimal fix will be in a separate nightly-only PR (#46809).