.cargo/vendor/cbindgen/tests/rust/struct_literal.rs
raw| 1 | #[repr(C)] |
| 2 | struct Foo { |
| 3 | a: i32, |
| 4 | b: u32, |
| 5 | } |
| 6 | |
| 7 | struct Bar { |
| 8 | a: i32, |
| 9 | b: u32, |
| 10 | } |
| 11 | |
| 12 | impl Foo { |
| 13 | pub const FOO: Foo = Foo { a: 42, b: 47, }; |
| 14 | pub const FOO2: Self = Foo { a: 42, b: 47, }; |
| 15 | pub const FOO3: Self = Self { a: 42, b: 47, }; |
| 16 | pub const BAZ: Bar = Bar { a: 42, b: 47, }; |
| 17 | } |
| 18 | |
| 19 | pub const BAR: Foo = Foo { a: 42, b: 1337, }; |
| 20 | pub const BAZZ: Bar = Bar { a: 42, b: 1337, }; |
| 21 | |
| 22 | #[no_mangle] |
| 23 | pub extern "C" fn root(x: Foo, bar: Bar) { } |