1 #[repr(C)]
2 pub struct Point<T> {
3     pub x: T,
4     pub y: T,
5 }
6 
7 #[repr(u8)]
8 pub enum Foo<T> {
9     Foo { x: i32, y: Point<T>, z: Point<f32>, },
10     Bar(T),
11     Baz(Point<T>),
12     Bazz,
13 }
14 
15 #[repr(C)]
16 pub enum Bar<T> {
17     Bar1 { x: i32, y: Point<T>, z: Point<f32>, u: unsafe extern "C" fn(i32) -> i32,  },
18     Bar2(T),
19     Bar3(Point<T>),
20     Bar4,
21 }
22 
23 #[repr(u8)]
24 pub enum Baz {
25     Baz1(Bar<u32>),
26     Baz2(Point<i32>),
27     Baz3,
28 }
29 
30 #[repr(C, u8)]
31 pub enum Taz {
32     Taz1(Bar<u32>),
33     Taz2(Baz),
34     Taz3,
35 }
36 
37 #[no_mangle]
foo( foo: *const Foo<i32>, bar: *const Bar<i32>, baz: *const Baz, taz: *const Taz, )38 pub extern "C" fn foo(
39     foo: *const Foo<i32>,
40     bar: *const Bar<i32>,
41     baz: *const Baz,
42     taz: *const Taz,
43 ) {}
44