Lokathor/bytemuck

Allow deriving `Zeroable` for enums which are `#[repr(u32, i8, etc..)]`

ARitz-Cracker opened this issue · 2 comments

If an enum is explicitly defined in a manner where "0" is a valid variant, and all the payloads of the 0 variant are zeroable, then it concludes that the enum is safely zeroable.

Additionally (though this may be a separate issue) an enum which is #[repr(u8)] and has all 256 variants explicitly defined can safely implement Pod.

That all sounds right to me.