]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/issue-34798.rs
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
[rust.git] / tests / ui / lint / issue-34798.rs
1 // run-pass
2 #![forbid(improper_ctypes)]
3 #![allow(dead_code)]
4
5 #[repr(C)]
6 pub struct Foo {
7     size: u8,
8     __value: ::std::marker::PhantomData<i32>,
9 }
10
11 #[repr(C)]
12 pub struct ZeroSizeWithPhantomData<T>(::std::marker::PhantomData<T>);
13
14 #[repr(C)]
15 pub struct Bar {
16     size: u8,
17     baz: ZeroSizeWithPhantomData<i32>,
18 }
19
20 extern "C" {
21     pub fn bar(_: *mut Foo, _: *mut Bar);
22 }
23
24 fn main() {
25 }