2017-02-09 13:00:38 +01:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
2017-02-09 11:15:56 +01:00
|
|
|
use std::mem;
|
|
|
|
|
|
|
|
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 10:58:30 +02:00
|
|
|
let foo_unsized: &Foo<dyn Send> = foo;
|
2017-02-09 11:15:56 +01:00
|
|
|
assert_eq!(mem::size_of_val(foo), mem::size_of_val(foo_unsized));
|
|
|
|
}
|