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

fix deriving CheckedBitPattern on packed struct #291

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Freax13
Copy link
Contributor

@Freax13 Freax13 commented Dec 28, 2024

This PR fixes the code emitted by the CheckedBitPattern derive macro to make it compatible with packed structs. It also adds a regression test for this.

When a field in a packed struct is not sufficiently aligned, it's
illegal to create a reference to it. Consequently, our Debug
implementation should not create references.

This does not affect enums because enums can't be packed.

Fixes: 5f9ce73
@Freax13
Copy link
Contributor Author

Freax13 commented Dec 28, 2024

AFAICT the failing CI check is unrelated to this PR (it also fails on main).

@Freax13 Freax13 changed the title fix deriving CheckedBitpattern on packed struct fix deriving CheckedBitPattern on packed struct Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant