Files
cbindgen/tests/rust/transform-op.rs
T
Emilio Cobos Álvarez ab9e3b814c ir: Fix generic enums with untagged bodies.
Boris hit this because he used #[repr(C)] instead of #[repr(u8)].

We were incorrectly writing the generic arguments twice for those.

I missed this difference in #219.

Fixes #225.
2018-10-17 14:11:37 -05:00

25 lines
394 B
Rust

#[repr(C)]
pub struct Point<T> {
pub x: T,
pub y: T,
}
#[repr(u8)]
pub enum Foo<T> {
Foo { x: i32, y: Point<T>, z: Point<f32>, },
Bar(T),
Baz(Point<T>),
Bazz,
}
#[repr(C)]
pub enum Bar<T> {
Bar1 { x: i32, y: Point<T>, z: Point<f32>, },
Bar2(T),
Bar3(Point<T>),
Bar4,
}
#[no_mangle]
pub extern "C" fn foo(foo: *const Foo<i32>, bar: *const Bar<i32>) {}