-
Notifications
You must be signed in to change notification settings - Fork 746
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
Conversation
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks!
@bors-servo r+ |
📌 Commit aa27283 has been approved by |
☀️ Test successful - status-travis |
@fitzgen r?
Fixes #1007 by ensuring that bitfields larger than type will be opaque, ensuring the layout is correct.