macro_rules! assert_align_lt { ($x:ty, $($y:ty),+ $(,)?) => { ... }; }
Expand description
Asserts that the types’ alignments are less than each other.
Examples
A u8
has smaller alignment than u16
, which has smaller alignment than
a pointer:
assert_align_lt!(u8, u16, *const u8);
The following example fails to compile because a usize
has the same
alignment as a pointer:
ⓘ
assert_align_lt!(*const u8, usize);