assert_size

Macro assert_size 

Source
macro_rules! assert_size {
    ($target:ty, $size:expr) => { ... };
}
Expand description

Asserts size of the type

#[repr(C)]
struct Foo {
    a: u32,
    b: i32
}
// Doesn't compile
// assert_size!(Foo, 4);

// Works fine
assert_size!(Foo, 8);