Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
joshlf opened this issue Sep 26, 2024 · 0 comments
Closed

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

joshlf opened this issue Sep 26, 2024 · 0 comments
Labels
blocking-next-release This issue should be resolved before we release on crates.io

Comments

@joshlf
Copy link
Member

joshlf commented Sep 26, 2024

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.

@joshlf joshlf added the blocking-next-release This issue should be resolved before we release on crates.io label Sep 26, 2024
joshlf added a commit that referenced this issue Sep 30, 2024
joshlf added a commit that referenced this issue Sep 30, 2024
github-merge-queue bot pushed a commit that referenced this issue Sep 30, 2024
* [derive] Don't support IntoBytes on repr(Rust) types

Closes #1764

* [derive] Correctly handle #[repr(align)] enums

Closes #1758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking-next-release This issue should be resolved before we release on crates.io
Projects
None yet
Development

No branches or pull requests

1 participant