the trait sm::CpuAligned is not public and not implemented for !Sized + sm::CpuLayout structs.
as of now, the following code doesn't compile
#[derive(sm::CpuLayout)]
#[repr(C)]
struct Unsized {
a: f32,
b: [f32],
}
< Unsized as sm::CpuAligned>::CPU_ALIGNMENT;
Solution:
- add
sm::CpuAligned to the public interface.
- add an impl block for
sm::CpuAligned in the #[derive(sm::CpuLayout)] macro that takes the same bounds as the impl block for sm::CpuLayout and infers the alignment and optional size from the fields.