]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-14309.rs
New upstream version 1.50.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-14309.rs
1 #![deny(improper_ctypes)]
2 #![allow(dead_code)]
3
4 struct A {
5 x: i32
6 }
7
8 #[repr(C, packed)]
9 struct B {
10 x: i32,
11 y: A
12 }
13
14 #[repr(C)]
15 struct C {
16 x: i32
17 }
18
19 type A2 = A;
20 type B2 = B;
21 type C2 = C;
22
23 #[repr(C)]
24 struct D {
25 x: C,
26 y: A
27 }
28
29 extern "C" {
30 fn foo(x: A); //~ ERROR type `A`, which is not FFI-safe
31 fn bar(x: B); //~ ERROR type `A`
32 fn baz(x: C);
33 fn qux(x: A2); //~ ERROR type `A`
34 fn quux(x: B2); //~ ERROR type `A`
35 fn corge(x: C2);
36 fn fred(x: D); //~ ERROR type `A`
37 }
38
39 fn main() { }