Using implicit padding on C FFI prevents Rust from writing / copying those bits #1324
Labels
E-medium
E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate.
Milestone
@sunfishcode pointed out here (#1321 (comment)) that when we use explicit padding on C FFI:
Rust will insert copies, etc. for the padding bits, and when users write code like:
those fields will be zeroed.
However, if we were to use
instead, this would not be the case.
We don't have that many types using
repr(align)
andrepr(packed)
explicitly, so we should manually check those against the C headers, and verify that they only use these attributes when C does so as well.The text was updated successfully, but these errors were encountered: