rust/tests/ui/issues/issue-35815.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
296 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
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-28 18:47:21 +00:00
let foo_unsized: &Foo<dyn Send> = foo;
assert_eq!(mem::size_of_val(foo), mem::size_of_val(foo_unsized));
}