Debian Codegraph @

.cargo/vendor/cbindgen/tests/rust/asserted_cast.rs

raw
1 /// cbindgen:prefix-with-name
2 #[repr(C, u8)]
3 pub enum H {
4 /// cbindgen:variant-mut-cast-attributes=MY_ATTRS
5 Foo(i16),
6 /// cbindgen:variant-const-cast-attributes=MY_ATTRS
7 Bar { x: u8, y: i16 },
8 /// cbindgen:variant-is-attributes=MY_ATTRS
9 Baz
10 }
11
12 /// cbindgen:prefix-with-name
13 #[repr(C, u8, u16)]
14 pub enum I {
15 /// cbindgen:variant-constructor-attributes=MY_ATTRS
16 Foo(i16),
17 /// cbindgen:eq-attributes=MY_ATTRS
18 Bar { x: u8, y: i16 },
19 Baz
20 }
21
22 /// cbindgen:prefix-with-name
23 #[repr(C, u8)]
24 pub enum J {
25 Foo(i16),
26 Bar { x: u8, y: i16 },
27 Baz
28 }
29
30 /// cbindgen:prefix-with-name
31 #[repr(u8)]
32 pub enum K {
33 Foo(i16),
34 Bar { x: u8, y: i16 },
35 Baz
36 }
37
38 #[no_mangle]
39 pub extern "C" fn foo(
40 h: H,
41 i: I,
42 j: J,
43 k: K,
44 ) {}