-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Allow #[repr(align(x))] on enums (#57996) #57998
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
r? @nagisa cc @eddyb @alexcrichton |
We discussed this PR briefly in the Lang Team meeting today. Folks generally feel comfortable with this addition (especially since it's unstable). The one question was: is this equivalent to wrapping in a struct with an alignment? Modulo clarifying that part of the spec, we are 👍 |
Awesome.
Yes, that is the intent. I added this to the docs. |
This needs a codegen test IMO. Otherwise looks good. |
Makes sense. Added a very basic codegen test (a6fd6ec). |
@bors r+ |
📌 Commit a6fd6ec has been approved by |
⌛ Testing commit a6fd6ec with merge ff672da096df7ab05d7e7374eeadb299e6a6347e... |
💔 Test failed - status-appveyor |
Allow #[repr(align(x))] on enums (#57996) Tracking issue: #57996 Implements an extension of [RFC 1358](https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md) behind a feature flag (`repr_align_enum`). Originally introduced here for structs: #39999. It seems like only HIR-level changes are required, since enums are already aware of their alignment (due to alignment of their limbs). cc @bitshifter
💔 Test failed - status-appveyor |
Allow #[repr(align(x))] on enums (#57996) Tracking issue: #57996 Implements an extension of [RFC 1358](https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md) behind a feature flag (`repr_align_enum`). Originally introduced here for structs: #39999. It seems like only HIR-level changes are required, since enums are already aware of their alignment (due to alignment of their limbs). cc @bitshifter
☀️ Test successful - checks-travis, status-appveyor |
Tracking issue: #57996
Implements an extension of RFC 1358 behind a feature flag (
repr_align_enum
). Originally introduced here for structs: #39999.It seems like only HIR-level changes are required, since enums are already aware of their alignment (due to alignment of their limbs).
cc @bitshifter