use std::mem; #[allow(dead_code)] struct Foo { a: i64, b: bool, c: T, } fn main() { let foo: &Foo = &Foo { a: 1, b: false, c: 2i32 }; let foo_unsized: &Foo = foo; assert_eq!(mem::size_of_val(foo), mem::size_of_val(foo_unsized)); }