Skip to content

Permit repr(packed) without repr(C) in some derives #1794

@joshlf

Description

@joshlf

Per the Reference:

The only data layout guarantees made by this representation are those required for soundness. They are:

  1. The fields are properly aligned.
  2. The fields do not overlap.
  3. The alignment of the type is at least the maximum alignment of its fields.

We currently require repr(C, packed), not just repr(packed), in some derives on the theory that Rust could cause fields to overlap as an optimization. This text promises never to do that, so we can probably permit repr(packed) in some cases.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions