-
Notifications
You must be signed in to change notification settings - Fork 698
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
Debug trait is derived when a struct contains __bindgen_padding #648
Comments
Thanks for the bug report! |
@leeopop both bitfields and deriving debug have undergone significant changes since you reported this; are you still able to reproduce on master? If so, the best way to help resolve this bug would be to get us a standalone test case we can reproduce ourselves with: https://github.com/servo/rust-bindgen/blob/master/CONTRIBUTING.md#using-creduce-to-minimize-test-cases Thanks! |
Hi ! I used creduce and get this result: struct {
void *schedule;
unsigned enqueue;
short *enqueue_burst;
unsigned enqueue_new_burst;
short *enqueue_forward_burst;
short *dequeue;
short dequeue_burst;
int *data;
int *dev_ops;
char attached
} __attribute__((__aligned__(64))); Once I run bindgen, I get
edit: |
Thanks! This is very helpful! Will dig into it. |
When there is large enough alignment that we might generate padding which has more members that `RUST_DERIVE_IN_ARRAY_LIMIT`, we can break our ability to derive traits. This commit solves this issue conservatively: there are cases where we leave a derive on the table, because in order to know that we could add that derive, we would need to compute padding before we determine whether we can derive. Fixes rust-lang#648
When there is large enough alignment that we might generate padding which has more members that `RUST_DERIVE_IN_ARRAY_LIMIT`, we can break our ability to derive traits. This commit solves this issue conservatively: there are cases where we leave a derive on the table, because in order to know that we could add that derive, we would need to compute padding before we determine whether we can derive. Fixes rust-lang#648
Input C/C++ Header
__rte_cache_aligned is 64byte alignment.
Bindgen Invokation
Actual Results
Expected Results
This structure contains [u8; 47] which does not implement Debug trait.
By the way, does [u8; 47] implements Copy trait?
struct rte_cryptodev should not derive Debug and Copy trait also.
#458
The text was updated successfully, but these errors were encountered: