diff --git a/sub/core/src/align.rs b/sub/core/src/align.rs index db1d9db..739c557 100644 --- a/sub/core/src/align.rs +++ b/sub/core/src/align.rs @@ -2,6 +2,16 @@ pub struct Align( ::Alignment ) where Self: Aligned; pub trait Aligned { type Alignment; } +impl Align where Self: Aligned { + const fn new() -> Self { unsafe { core::mem::zeroed() } } +} + +unsafe impl crate::data::Zeroed for Align where Self: Aligned {} + +impl Default for Align where Self: Aligned { + fn default() -> Self { Self::new() } +} + macro_rules! gen_alignment { ($($alignment:literal),+) => { $(