summaryrefslogtreecommitdiffstats
path: root/src/test/ui/struct-ctor-mangling.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/struct-ctor-mangling.rs')
-rw-r--r--src/test/ui/struct-ctor-mangling.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/struct-ctor-mangling.rs b/src/test/ui/struct-ctor-mangling.rs
new file mode 100644
index 000000000..ba6abbf03
--- /dev/null
+++ b/src/test/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);
+}