Skip to content

Unnamed bit-fields and alignment #1130

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

Merged
merged 2 commits into from
Nov 1, 2017
Merged

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Oct 31, 2017

According to the x86[-64] ABI spec: "Unnamed bit-fields’ types do not affect the
alignment of a structure or union". This makes sense: such bit-fields are only
used for padding, and we can't perform an un-aligned read of something we can't
read because we can't even name it.

Fixes rust-lang#1076
@pepyakin
Copy link
Contributor

pepyakin commented Nov 1, 2017

Looks great!

@bors-servo r+

@bors-servo
Copy link

📌 Commit e17bd8d has been approved by pepyakin

@bors-servo
Copy link

⌛ Testing commit e17bd8d with merge ddb680b...

bors-servo pushed a commit that referenced this pull request Nov 1, 2017
Unnamed bit-fields and alignment

r? @pepyakin or @emilio
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: pepyakin
Pushing ddb680b to master...

@bors-servo bors-servo merged commit e17bd8d into rust-lang:master Nov 1, 2017
@fitzgen
Copy link
Member Author

fitzgen commented Nov 1, 2017

Thanks for review :)

@fitzgen fitzgen deleted the issue-1076 branch November 1, 2017 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants