Skip to content

Audit behavior of derives on #[repr(align(...))] enums #1758

@joshlf

Description

@joshlf

For example, this enum has size 2 despite being #[repr(u8)]:

#[repr(u8, align(2))]
enum Foo {
    A,
}

This is a subtle edge case; we should audit our derive code to make sure all enum derives handle this case correctly.

This is especially important in combination with #1752 which (as of this writing) synthesizes tag enums with the exact same #[repr(...)] attribute as the user's type, including any align reprs. That is new behavior as of that PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocking-next-releaseThis issue should be resolved before we release on crates.io

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions