2017-02-09 04:15:56 -06:00
|
|
|
use std::mem;
|
|
|
|
|
2020-04-16 02:25:12 -05:00
|
|
|
#[allow(dead_code)]
|
2017-02-09 04:15:56 -06:00
|
|
|
struct Foo<T: ?Sized> {
|
|
|
|
a: i64,
|
|
|
|
b: bool,
|
|
|
|
c: T,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let foo: &Foo<i32> = &Foo { a: 1, b: false, c: 2i32 };
|
2019-05-30 03:58:30 -05:00
|
|
|
let foo_unsized: &Foo<dyn Send> = foo;
|
2017-02-09 04:15:56 -06:00
|
|
|
assert_eq!(mem::size_of_val(foo), mem::size_of_val(foo_unsized));
|
|
|
|
}
|