Lokathor/bytemuck

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

Opened this issue · 2 comments

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)

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

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