#![feature(concat_idents)] use core::mem::align_of; use static_assertions::*; use typic::{self, internal::*}; mod zst { use super::*; #[typic::repr(C)] struct ZST_C; #[typic::repr()] struct ZST_Rust; #[typic::repr(packed)] struct ZST_Packed; const_assert_eq![1, align_of::()]; const_assert_eq![1, align_of::()]; const_assert_eq![1, align_of::()]; assert_type_eq_all![ MinAlign, ::ReprAlign, ::ReprAlign, ::ReprAlign, ]; assert_type_eq_all![ MaxAlign, ::ReprPacked, ::ReprPacked, ::ReprPacked, ]; } mod align_1 { use super::*; #[typic::repr(align(1))] struct Align1; const_assert_eq![1, align_of::()]; assert_type_eq_all!(::ReprAlign, MinAlign); assert_type_eq_all!(::ReprPacked, MaxAlign); } mod multi_align { use super::*; #[typic::repr(align(2), align(4))] struct Align2_4; #[typic::repr(align(4), align(2))] struct Align4_2; const_assert_eq![4, align_of::()]; const_assert_eq![4, align_of::()]; assert_type_eq_all![ U4, ::ReprAlign, ::ReprAlign, ]; }