macro_rules! assert_align_le {
    ($x:ty, $($y:ty),+ $(,)?) => { ... };
}
Expand description

Asserts that the types’ alignments are less than or equal to each other.

Examples

A u8 and i8 have smaller alignment than any pointer type:

assert_align_le!(u8, i8, *const u8);

The following example fails to compile because a usize has greater alignment than u8:

assert_align_le!(usize, u8);