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

Allow deriving Pod for structs where generics are used only as PhantomData #191

Open
vadorovsky opened this issue May 26, 2023 · 2 comments

Comments

@vadorovsky
Copy link

Currently, bytemuck disallows to derive Pod if the struct has any generics:

Pod requires cannot be derived for non-packed types containing \
generic parameters because the padding requirements can't be verified \
for generic non-packed structs\

However, if generics are used only as PhantomData inside #[repr(C)] struct, that should be still OK. (I ended up doing unsafe impl bytemuck::Podmyself in such cases)

@wdanilo
Copy link

wdanilo commented May 26, 2023

I believe this is duplicate of what I raised yesterday (at least both problems could be solved by the same thing): #190

@Lokathor
Copy link
Owner

I think a solution to 190 would solve this too but we can keep this issue open just in case.

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

No branches or pull requests

3 participants