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

Allow #[repr(align(x))] on enums (#57996) #57998

Merged
merged 4 commits into from Feb 7, 2019
Merged

Conversation

@niklasf
Copy link
Contributor

@niklasf niklasf commented Jan 30, 2019

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

@rust-highfive
Copy link
Collaborator

@rust-highfive rust-highfive commented Jan 30, 2019

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.

@Centril
Copy link
Contributor

@Centril Centril commented Jan 31, 2019

@rust-highfive rust-highfive assigned nagisa and unassigned steveklabnik Jan 31, 2019
@aturon
Copy link
Member

@aturon aturon commented Jan 31, 2019

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 👍

@niklasf
Copy link
Contributor Author

@niklasf niklasf commented Jan 31, 2019

Awesome.

is this equivalent to wrapping in a struct with an alignment?

Yes, that is the intent. I added this to the docs.

@Centril Centril removed the T-lang label Jan 31, 2019
@nagisa
Copy link
Contributor

@nagisa nagisa commented Feb 1, 2019

This needs a codegen test IMO. Otherwise looks good.

@niklasf
Copy link
Contributor Author

@niklasf niklasf commented Feb 1, 2019

Makes sense. Added a very basic codegen test (a6fd6ec).

@nagisa
Copy link
Contributor

@nagisa nagisa commented Feb 5, 2019

@bors r+

@bors
Copy link
Contributor

@bors bors commented Feb 5, 2019

📌 Commit a6fd6ec has been approved by nagisa

@bors
Copy link
Contributor

@bors bors commented Feb 6, 2019

Testing commit a6fd6ec with merge ff672da...

bors added a commit that referenced this pull request Feb 6, 2019
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
@bors
Copy link
Contributor

@bors bors commented Feb 6, 2019

💔 Test failed - status-appveyor

@kennytm
Copy link
Member

@kennytm kennytm commented Feb 6, 2019

@bors retry #58025

@bors
Copy link
Contributor

@bors bors commented Feb 6, 2019

Testing commit a6fd6ec with merge 631a162...

bors added a commit that referenced this pull request Feb 6, 2019
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
@bors
Copy link
Contributor

@bors bors commented Feb 6, 2019

💔 Test failed - status-appveyor

@kennytm
Copy link
Member

@kennytm kennytm commented Feb 6, 2019

@bors retry #58160

@bors
Copy link
Contributor

@bors bors commented Feb 7, 2019

Testing commit a6fd6ec with merge 825f355...

bors added a commit that referenced this pull request Feb 7, 2019
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
@bors
Copy link
Contributor

@bors bors commented Feb 7, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: nagisa
Pushing 825f355 to master...

@bors bors merged commit a6fd6ec into rust-lang:master Feb 7, 2019
2 checks passed
2 checks passed
@travis-ci
Travis CI - Pull Request Build Passed
Details
@bors
homu Test successful
Details
@bors bors mentioned this pull request Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

9 participants