Open ARitz-Cracker opened 6 months ago
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.
#[repr(u8)]
Pod
That all sounds right to me.
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.