]> git.lizzy.rs Git - rust.git/blob - tests/ui/struct-ctor-mangling.rs
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / ui / struct-ctor-mangling.rs
1 // run-pass
2
3 fn size_of_val<T>(_: &T) -> usize {
4     std::mem::size_of::<T>()
5 }
6
7 struct Foo(#[allow(unused_tuple_struct_fields)] i64);
8
9 // Test that the (symbol) mangling of `Foo` (the `struct` type) and that of
10 // `typeof Foo` (the function type of the `struct` constructor) don't collide.
11 fn main() {
12     size_of_val(&Foo(0));
13     size_of_val(&Foo);
14 }