Macro static_assertions::assert_eq_size_val [−][src]
Asserts that values are equal in size.
This macro doesn’t consume its arguments and thus works for
non-Clone
able values.
Examples
struct Byte(u8); let x = 10u8; let y = Byte(42); // Works for non-cloneable types assert_eq_size_val!(x, y); assert_eq_size_val!(x, y, 0u8);
Even though both values are 0, they are of types with different sizes:
ⓘ
assert_eq_size_val!(0u8, 0u32);