summaryrefslogtreecommitdiffstats
path: root/tests/rust/union_self.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rust/union_self.rs')
-rw-r--r--tests/rust/union_self.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/rust/union_self.rs b/tests/rust/union_self.rs
new file mode 100644
index 0000000..77b0b0f
--- /dev/null
+++ b/tests/rust/union_self.rs
@@ -0,0 +1,14 @@
+#[repr(C)]
+pub struct Foo<T> {
+ something: *const i32,
+ phantom: std::marker::PhantomData<T>,
+}
+
+#[repr(C)]
+pub union Bar {
+ something: i32,
+ subexpressions: Foo<Self>,
+}
+
+#[no_mangle]
+pub extern "C" fn root(b: Bar) {}