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

Make bitfields larger than type opaque #1060

Merged
merged 1 commit into from Oct 5, 2017

Conversation

Projects
None yet
4 participants
@aeleos
Copy link
Contributor

aeleos commented Oct 4, 2017

@fitzgen r?

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

@fitzgen
Copy link
Member

fitzgen left a comment

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

return true
}

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

This comment has been minimized.

@fitzgen

fitzgen Oct 4, 2017

Member

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

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

This comment has been minimized.

@fitzgen

fitzgen Oct 4, 2017

Member

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

@fitzgen

fitzgen approved these changes Oct 5, 2017

Copy link
Member

fitzgen left a comment

👍 thanks!

@fitzgen

This comment has been minimized.

Copy link
Member

fitzgen commented Oct 5, 2017

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented Oct 5, 2017

📌 Commit aa27283 has been approved by fitzgen

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented Oct 5, 2017

⌛️ Testing commit aa27283 with merge 8387c7f...

bors-servo added a commit that referenced this pull request Oct 5, 2017

Auto merge of #1060 - aeleos:master, r=fitzgen
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

This comment has been minimized.

Copy link
Contributor

bors-servo commented Oct 5, 2017

☀️ 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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.