Closed waywardmonkeys closed 2 weeks ago
Do you also need to implement the TransparentWrapper
trait to be strictly conforming with bytemuck's expecations?
Do you also need to implement the
TransparentWrapper
trait to be strictly conforming with bytemuck's expecations?
I did when I switched to repr(transparent)
.
AlphaColor
,OpaqueColor
, andPremulColor
are now using#[repr(transparent)]
and impl thebytemuck
traitsPod
,TransparentWrapper
, andZeroable
.Rgba8
is now#[repr(C)]
and impls thebytemuck
traitsPod
andZeroable
.The
bytemuck
traits are only available when the newbytemuck
feature is enabled. It is not enabled by default.This requires relaxing the forbidding of
unsafe_code
as the impls of thebytemuck
traits must useunsafe impl
.