#[repr(C)]
struct S {
a: u8,
b: u16
}
let almost_zero: S = transmute([0u8, 13, 0, 0]);
almost_zero does not pass is_mem_zero as defined above, but it would presumably test as zero with a more specialized implementation. However, this is means it’s just a missed opportunity for optimization, using alloc followed by copy is still correct. My proposal for is_mem_zero would allow all current types that use is_zero as well as many user-defined types to use the optimized paths, without requiring any public stabilization of traits or features.