-
Notifications
You must be signed in to change notification settings - Fork 745
codegen: Support repr(align) #1271
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
pub struct a { | ||
pub b: ::std::os::raw::c_int, | ||
pub c: ::std::os::raw::c_int, | ||
pub __bindgen_align: [u64; 0usize], |
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.
Do we still need to generate this, then?
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.
Not really, but it doesn't hurt and avoids having the extra codepath and conditionals.
tests/headers/repr-align.hpp
Outdated
@@ -0,0 +1,6 @@ | |||
// bindgen-flags: --rust-target 1.24 -- -std=c++11 | |||
|
|||
struct alignas(8) a { |
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.
Could you add another testcase with alignas(double)
? And probably do so with 32bit Linux as target, given that's where the original issue is.
Also maybe add testcase for things when alignas
is on field rather than type?
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.
Sure, will add. We don't run tests on linux32 though, so I won't do that, since it wouldn't test anything extra.
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.
I think adding -m32
should be enough?
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.
Added
@bors-servo r+ Although it would still be good if you have a test for |
📌 Commit 1923985 has been approved by |
codegen: Support repr(align) Fixes #917.
💔 Test failed - status-travis |
So turns out this feature is really |
☔ The latest upstream changes (presumably #1273) made this pull request unmergeable. Please resolve the merge conflicts. |
Otherwise we can't use repr(align) on stylo.
@bors-servo r=xidorn |
📌 Commit 853ae4d has been approved by |
codegen: Support repr(align) Fixes #917.
☀️ Test successful - status-travis |
Fixes #917.