You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While this is already implied by the type layout docs, it's easy to miss since the type layout docs describe reprs as guaranteeing things about the layout, and the special case of repr(packed(1))does guarantee size.
In particular, call out the following:
A repr(packed(N)) struct's size may change depending on field order
As a special case, a repr(packed(1)) or repr(packed) struct's size does not depend on field order
A repr(align(N)) struct's size may change depending on field order
In each of these cases, suggest using repr(C) to guarantee field order if guaranteed size is important
The text was updated successfully, but these errors were encountered:
While this is already implied by the type layout docs, it's easy to miss since the type layout docs describe reprs as guaranteeing things about the layout, and the special case of
repr(packed(1))
does guarantee size.In particular, call out the following:
repr(packed(N))
struct's size may change depending on field orderrepr(packed(1))
orrepr(packed)
struct's size does not depend on field orderrepr(align(N))
struct's size may change depending on field orderrepr(C)
to guarantee field order if guaranteed size is importantThe text was updated successfully, but these errors were encountered: