summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/issue-34798.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lint/issue-34798.rs')
-rw-r--r--tests/ui/lint/issue-34798.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/lint/issue-34798.rs b/tests/ui/lint/issue-34798.rs
new file mode 100644
index 000000000..f0d710123
--- /dev/null
+++ b/tests/ui/lint/issue-34798.rs
@@ -0,0 +1,25 @@
+// run-pass
+#![forbid(improper_ctypes)]
+#![allow(dead_code)]
+
+#[repr(C)]
+pub struct Foo {
+ size: u8,
+ __value: ::std::marker::PhantomData<i32>,
+}
+
+#[repr(C)]
+pub struct ZeroSizeWithPhantomData<T>(::std::marker::PhantomData<T>);
+
+#[repr(C)]
+pub struct Bar {
+ size: u8,
+ baz: ZeroSizeWithPhantomData<i32>,
+}
+
+extern "C" {
+ pub fn bar(_: *mut Foo, _: *mut Bar);
+}
+
+fn main() {
+}