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

Support deriving AsBytes on generic repr(packed) structs #127

Closed
joshlf opened this issue Nov 7, 2022 · 0 comments · Fixed by #128
Closed

Support deriving AsBytes on generic repr(packed) structs #127

joshlf opened this issue Nov 7, 2022 · 0 comments · Fixed by #128
Assignees
Labels
blocking-next-release This issue should be resolved before we release on crates.io

Comments

@joshlf
Copy link
Member

joshlf commented Nov 7, 2022

We support deriving AsBytes on generic repr(transparent) structs because we don't need to explicitly check for padding, and so we don't need to emit code that's incompatible with generic type arguments. We ought to be able to use the same approach to support generic repr(packed) structs as well.

EDIT: Looks like we do support them, but there are no tests for that support, and our error messages imply that we don't support them. We should clean that up.

cc @djkoloski

@joshlf joshlf changed the title Support deriving AsBytes on generic repr(packed) structs Support deriving AsBytes on generic repr(packed) structs Nov 7, 2022
@joshlf joshlf self-assigned this Nov 7, 2022
@joshlf joshlf added the blocking-next-release This issue should be resolved before we release on crates.io label Nov 7, 2022
joshlf added a commit that referenced this issue Nov 7, 2022
Unify our handling of `repr(packed)` and `repr(transparent)` when
deriving `AsBytes`, and bring error messages up to date with the fact
that we support both of these reprs on generic structs.

Closes #127
joshlf added a commit that referenced this issue Nov 7, 2022
Unify our handling of `repr(packed)` and `repr(transparent)` when
deriving `AsBytes`, and bring error messages up to date with the fact
that we support both of these reprs on generic structs.

Closes #127
joshlf added a commit that referenced this issue Nov 7, 2022
Unify our handling of `repr(packed)` and `repr(transparent)` when
deriving `AsBytes`, and bring error messages up to date with the fact
that we support both of these reprs on generic structs.

Closes #127
joshlf added a commit that referenced this issue Aug 3, 2023
Unify our handling of `repr(packed)` and `repr(transparent)` when
deriving `AsBytes`, and bring error messages up to date with the fact
that we support both of these reprs on generic structs.

Closes #127
@joshlf joshlf mentioned this issue Aug 20, 2023
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

Successfully merging a pull request may close this issue.

1 participant