mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-17 19:14:16 +00:00
15 lines
338 B
Rust
15 lines
338 B
Rust
//@ run-pass
|
|
|
|
fn size_of_val<T>(_: &T) -> usize {
|
|
std::mem::size_of::<T>()
|
|
}
|
|
|
|
struct Foo(#[allow(dead_code)] i64);
|
|
|
|
// Test that the (symbol) mangling of `Foo` (the `struct` type) and that of
|
|
// `typeof Foo` (the function type of the `struct` constructor) don't collide.
|
|
fn main() {
|
|
size_of_val(&Foo(0));
|
|
size_of_val(&Foo);
|
|
}
|