about summary refs log tree commit diff
path: root/tests/ui/struct-ctor-mangling.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/struct-ctor-mangling.rs')
-rw-r--r--tests/ui/struct-ctor-mangling.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/struct-ctor-mangling.rs b/tests/ui/struct-ctor-mangling.rs
new file mode 100644
index 00000000000..ba6abbf03a5
--- /dev/null
+++ b/tests/ui/struct-ctor-mangling.rs
@@ -0,0 +1,14 @@
+// run-pass
+
+fn size_of_val<T>(_: &T) -> usize {
+    std::mem::size_of::<T>()
+}
+
+struct Foo(#[allow(unused_tuple_struct_fields)] 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);
+}