Skip to content

Make bitfields larger than type opaque #1060

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 1 commit into from
Oct 5, 2017
Merged

Make bitfields larger than type opaque #1060

merged 1 commit into from
Oct 5, 2017

Conversation

aeleos
Copy link
Contributor

@aeleos aeleos commented Oct 4, 2017

@fitzgen r?

Fixes #1007 by ensuring that bitfields larger than type will be opaque, ensuring the layout is correct.

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Two tiny little nitpicks and then we can merge this :)

src/ir/comp.rs Outdated
return true
}

let has_large_bitfield = self.fields().iter().any(|f| match *f {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: rather than assigning the bool expression to a variable and then returning the variable, we should return the expression directly.

src/ir/comp.rs Outdated
fn is_opaque(&self, _: &BindgenContext, _: &()) -> bool {
self.has_non_type_template_params
fn is_opaque(&self, ctx: &BindgenContext, _: &()) -> bool {
//Early return to avoid extra computation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: space between // and Early, and a period at the end of the sentence please :)

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks!

@fitzgen
Copy link
Member

fitzgen commented Oct 5, 2017

@bors-servo r+

@bors-servo
Copy link

📌 Commit aa27283 has been approved by fitzgen

@bors-servo
Copy link

⌛ Testing commit aa27283 with merge 8387c7f...

bors-servo pushed a commit that referenced this pull request Oct 5, 2017
Make bitfields larger than type opaque

@fitzgen r?

Fixes #1007 by ensuring that bitfields larger than type will be opaque, ensuring the layout is correct.
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: fitzgen
Pushing 8387c7f to master...

@bors-servo bors-servo merged commit aa27283 into rust-lang:master Oct 5, 2017
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