Skip to content

What guarantees are provided by repr(packed)? #318

Open
@joshlf

Description

@joshlf

Per the nomicon, repr(packed) guarantees that all inter-field padding is removed. However, the reference merely says that "packed may also alter the padding between fields" (emphasis added).

What guarantees does repr(packed) provide? In particular:

  • Does repr(packed) guarantee that all inter-field padding is removed?
  • Does repr(packed) guarantee that a type's layout is fixed in any way other than removing padding (e.g., field ordering)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions