$ cargo test
Compiling bitflags v0.7.0
Compiling rustc-serialize v0.3.19
Compiling glob v0.2.11
Compiling unicode-xid v0.0.3
Compiling winapi-build v0.1.1
Compiling bitflags v0.5.0
Compiling winapi v0.2.8
Compiling libc v0.2.14
Compiling log v0.3.6
Compiling kernel32-sys v0.2.2
Compiling term v0.4.4
Compiling clang-sys v0.8.1
Compiling syntex_pos v0.38.0
Compiling syntex_errors v0.38.0
Compiling syntex_syntax v0.38.0
Compiling aster v0.21.1
Compiling quasi v0.15.0
Compiling syntex v0.38.0
Compiling quasi_codegen v0.15.0
Compiling bindgen v0.16.0 (file:///Users/fitzgen/src/rust-bindgen)
tests/test_cxx.rs:1:5: 1:12 warning: unused import, #[warn(unused_imports)] on by default
tests/test_cxx.rs:1 use bindgen;
^~~~~~~
Running target/debug/bindgen-be57e02bfe45306e
running 1 test
test builder_state ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
Running target/debug/bindgen-0e203d5c160e4a07
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
Running target/debug/tests-98ced5f25666801d
running 33 tests
error: error reading 'tests/headers/builtin_va_list.h'
test test_builtins::test_builtin_va_list ... FAILED
test test_decl::ptr_to_array ... ok
test test_enum::with_duplicate_enum_value ... FAILED
test test_enum::with_simple_enum ... FAILED
test test_enum::with_overflowed_enum_value ... FAILED
test test_enum::with_packed_enums ... FAILED
test test_enum::with_explicitly_typed_cxx_enum ... FAILED
test test_cxx::test_cxx_template ... FAILED
test test_cxx::test_cxx_class ... FAILED
test test_func::func_proto ... ok
test test_func::with_array_arg ... ok
test test_func::func_ptr ... ok
test test_extern::extern_c_in_hpp ... ok
test test_func::func_ptr_in_struct ... FAILED
test test_func::with_func_ptr_arg ... ok
test test_struct::containing_fwd_decl_struct ... FAILED
test test_struct::packed_struct ... FAILED
test test_struct::with_anon_struct_pointer ... FAILED
test test_struct::with_anon_struct ... FAILED
test test_struct::with_anon_struct_array ... FAILED
test test_struct::with_anon_unnamed_struct ... FAILED
test test_struct::with_anon_union ... FAILED
test test_struct::with_anon_unnamed_union ... FAILED
test test_struct::with_fwd_decl_struct ... FAILED
test test_union::with_anon_struct ... FAILED
test test_struct::with_bitfields ... FAILED
test test_union::with_anon_struct_bitfield ... FAILED
test test_union::with_anon_union ... FAILED
test test_union::with_anon_unnamed_struct ... FAILED
test test_struct::with_nesting ... FAILED
test test_union::with_anon_unnamed_union ... FAILED
test test_union::with_derive_debug ... FAILED
test test_union::with_nesting ... FAILED
failures:
---- test_builtins::test_builtin_va_list stdout ----
thread 'test_builtins::test_builtin_va_list' panicked at 'called `Result::unwrap()` on an `Err` value: ()', ../src/libcore/result.rs:788
note: Run with `RUST_BACKTRACE=1` for a backtrace.
---- test_enum::with_duplicate_enum_value stdout ----
Generated bindings for headers/enum_dupe.h do not match the reference bindings.
Generated:
pub const Dupe: Enum_Foo = Enum_Foo::Bar;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo { Bar = 1, }
Reference:
pub const Dupe: Enum_Foo = Enum_Foo::Bar;
#[repr(u32)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Foo { Bar = 1, }
thread 'test_enum::with_duplicate_enum_value' panicked at 'explicit panic', tests/support.rs:66
---- test_enum::with_simple_enum stdout ----
Generated bindings for headers/enum.h do not match the reference bindings.
Generated:
#[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo { Bar = 0, Qux = 1, }
#[repr(i32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Neg { MinusOne = -1, One = 1, }
Reference:
#[repr(u32)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Foo { Bar = 0, Qux = 1, }
#[repr(i32)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Neg { MinusOne = -1, One = 1, }
thread 'test_enum::with_simple_enum' panicked at 'explicit panic', tests/support.rs:66
---- test_enum::with_overflowed_enum_value stdout ----
Generated bindings for headers/overflowed_enum.hpp do not match the reference bindings.
Generated:
#[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo {
BAP_ARM = 9698489,
BAP_X86 = 11960045,
BAP_X86_64 = 3128633167,
}
#[repr(u16)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Bar { One = 1, Big = 2, }
Reference:
#[repr(u32)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Foo {
BAP_ARM = 9698489,
BAP_X86 = 11960045,
BAP_X86_64 = 3128633167,
}
#[repr(u16)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Bar { One = 1, Big = 2, }
thread 'test_enum::with_overflowed_enum_value' panicked at 'explicit panic', tests/support.rs:66
---- test_enum::with_packed_enums stdout ----
Generated bindings for headers/enum_packed.h do not match the reference bindings.
Generated:
#[repr(u8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo { Bar = 0, Qux = 1, }
#[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Neg { MinusOne = -1, One = 1, }
#[repr(u16)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Bigger { Much = 255, Larger = 256, }
Reference:
#[repr(u8)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Foo { Bar = 0, Qux = 1, }
#[repr(i8)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Neg { MinusOne = -1, One = 1, }
#[repr(u16)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Bigger { Much = 255, Larger = 256, }
thread 'test_enum::with_packed_enums' panicked at 'explicit panic', tests/support.rs:66
---- test_enum::with_explicitly_typed_cxx_enum stdout ----
Generated bindings for headers/enum_explicit_type.hpp do not match the reference bindings.
Generated:
#[repr(u8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo { Bar = 0, Qux = 1, }
#[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Neg { MinusOne = -1, One = 1, }
#[repr(u16)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Bigger { Much = 255, Larger = 256, }
#[repr(i64)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_MuchLong { MuchLow = -4294967296, }
#[repr(u64)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_MuchLongLong { MuchHigh = 4294967296, }
Reference:
#[repr(u8)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Foo { Bar = 0, Qux = 1, }
#[repr(i8)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Neg { MinusOne = -1, One = 1, }
#[repr(u16)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_Bigger { Much = 255, Larger = 256, }
#[repr(i64)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_MuchLong { MuchLow = -4294967296, }
#[repr(u64)]
#[derive(Copy, Clone, Debug)]
pub enum Enum_MuchLongLong { MuchHigh = 4294967296, }
thread 'test_enum::with_explicitly_typed_cxx_enum' panicked at 'explicit panic', tests/support.rs:66
---- test_cxx::test_cxx_template stdout ----
*** NestedReplaced: found previous translation
*** ReplacedWithoutDestructor: found previous translation
Generated bindings for headers/template.hpp do not match the reference bindings.
Generated:
#[repr(C)]
#[derive(Debug)]
pub struct Foo<T, U> {
pub m_member: T,
pub m_member_ptr: *mut T,
pub m_member_arr: [T; 1usize],
pub _phantom0: ::std::marker::PhantomData<U>,
}
#[repr(C)]
#[derive(Debug)]
pub struct D<T> {
pub m_foo: Foo<::std::os::raw::c_int, ::std::os::raw::c_int>,
pub _phantom0: ::std::marker::PhantomData<T>,
}
#[repr(C)]
#[derive(Debug)]
pub struct D_U<T, Z> {
pub m_nested_foo: Foo<::std::os::raw::c_int, ::std::os::raw::c_int>,
pub m_baz: Z,
pub _phantom0: ::std::marker::PhantomData<T>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Rooted<T> {
pub prev: *mut T,
pub next: *mut Rooted<*mut ::std::os::raw::c_void>,
pub ptr: T,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct RootedContainer {
pub root: Rooted<*mut ::std::os::raw::c_void>,
}
impl ::std::clone::Clone for RootedContainer {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_RootedContainer() {
assert_eq!(::std::mem::size_of::<RootedContainer>() , 24usize);
assert_eq!(::std::mem::align_of::<RootedContainer>() , 8usize);
}
pub type WithDtorIntFwd = WithDtor<::std::os::raw::c_int>;
#[repr(C)]
#[derive(Debug)]
pub struct WithDtor<T> {
pub member: T,
}
#[repr(C)]
#[derive(Debug)]
pub struct PODButContainsDtor {
pub member: WithDtorIntFwd,
}
#[test]
fn bindgen_test_layout_PODButContainsDtor() {
assert_eq!(::std::mem::size_of::<PODButContainsDtor>() , 4usize);
assert_eq!(::std::mem::align_of::<PODButContainsDtor>() , 4usize);
}
#[repr(C)]
pub struct Opaque;
#[repr(C)]
pub struct POD {
pub opaque_member: u32,
}
#[test]
fn bindgen_test_layout_POD() {
assert_eq!(::std::mem::size_of::<POD>() , 4usize);
assert_eq!(::std::mem::align_of::<POD>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct NestedBase<T, U> {
pub buff: *mut T,
pub _phantom0: ::std::marker::PhantomData<U>,
}
/**
* <div rustbindgen replaces="NestedReplaced"></div>
*/
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct NestedReplaced<T> {
pub buff: *mut T,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct NestedContainer<T> {
pub c: T,
pub nested: NestedReplaced<T>,
pub inc: Incomplete<T>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Incomplete<T> {
pub d: T,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Untemplated;
impl ::std::clone::Clone for Untemplated {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Templated<T> {
pub m_untemplated: Untemplated,
pub _phantom0: ::std::marker::PhantomData<T>,
}
/**
* If the replacement doesn't happen at the parse level the container would be
* copy and the replacement wouldn't, so this wouldn't compile.
*
* <div rustbindgen replaces="ReplacedWithoutDestructor"></div>
*/
#[repr(C)]
#[derive(Debug)]
pub struct ReplacedWithoutDestructor<T> {
pub buff: *mut T,
}
/**
* If the replacement doesn't happen at the parse level the container would be
* copy and the replacement wouldn't, so this wouldn't compile.
*
* <div rustbindgen replaces="ReplacedWithoutDestructorFwd"></div>
*/
#[repr(C)]
#[derive(Debug)]
pub struct ReplacedWithoutDestructorFwd<T> {
pub buff: *mut T,
}
#[repr(C)]
#[derive(Debug)]
pub struct ShouldNotBeCopiable<T> {
pub m_member: ReplacedWithoutDestructor<T>,
}
#[repr(C)]
#[derive(Debug)]
pub struct ShouldNotBeCopiableAsWell<U> {
pub m_member: ReplacedWithoutDestructorFwd<U>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TemplateWithVar<T> {
pub _phantom0: ::std::marker::PhantomData<T>,
}
extern "C" {
#[link_name = "_Z3bar3FooIiiE"]
pub fn bar(foo: Foo<::std::os::raw::c_int, ::std::os::raw::c_int>);
}
Reference:
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Foo<T> {
pub m_member: T,
}
extern "C" {
#[link_name = "_Z3bar3FooIiE"]
pub fn bar(foo: Foo<::std::os::raw::c_int>);
}
thread 'test_cxx::test_cxx_template' panicked at 'explicit panic', tests/support.rs:66
---- test_cxx::test_cxx_class stdout ----
Generated bindings for headers/class.hpp do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Copy)]
pub struct C {
pub a: ::std::os::raw::c_int,
pub big_array: [::std::os::raw::c_char; 33usize],
}
impl ::std::clone::Clone for C {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_C() {
assert_eq!(::std::mem::size_of::<C>() , 40usize);
assert_eq!(::std::mem::align_of::<C>() , 4usize);
}
#[repr(C)]
#[derive(Debug)]
pub struct WithDtor {
pub b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_WithDtor() {
assert_eq!(::std::mem::size_of::<WithDtor>() , 4usize);
assert_eq!(::std::mem::align_of::<WithDtor>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union {
pub d: __BindgenUnionField<f32>,
pub i: __BindgenUnionField<::std::os::raw::c_int>,
pub _bindgen_data_: u32,
}
impl Union {
pub unsafe fn d(&mut self) -> *mut f32 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn i(&mut self) -> *mut ::std::os::raw::c_int {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union() {
assert_eq!(::std::mem::size_of::<Union>() , 4usize);
assert_eq!(::std::mem::align_of::<Union>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct WithUnion {
pub data: Union,
}
impl ::std::clone::Clone for WithUnion {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_WithUnion() {
assert_eq!(::std::mem::size_of::<WithUnion>() , 4usize);
assert_eq!(::std::mem::align_of::<WithUnion>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy, Clone)]
pub struct C {
pub a: ::std::os::raw::c_int,
}
thread 'test_cxx::test_cxx_class' panicked at 'explicit panic', tests/support.rs:66
---- test_func::func_ptr_in_struct stdout ----
Generated bindings for headers/func_ptr_in_struct.h do not match the reference bindings.
Generated:
#[repr(i32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_baz { _BindgenOpaqueEnum = 0, }
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_Foo {
pub bar: ::std::option::Option<unsafe extern "C" fn(x:
::std::os::raw::c_int,
y:
::std::os::raw::c_int)
-> Enum_baz>,
}
impl ::std::clone::Clone for Struct_Foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_Foo() {
assert_eq!(::std::mem::size_of::<Struct_Foo>() , 8usize);
assert_eq!(::std::mem::align_of::<Struct_Foo>() , 8usize);
}
Reference:
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_Foo {
pub bar: ::std::option::Option<unsafe extern "C" fn(x:
::std::os::raw::c_int,
y:
::std::os::raw::c_int)
-> Enum_baz>,
}
thread 'test_func::func_ptr_in_struct' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::containing_fwd_decl_struct stdout ----
Generated bindings for headers/struct_containing_forward_declared_struct.h do not match the reference bindings.
Generated:
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_a {
pub val_a: *mut Struct_b,
}
impl ::std::clone::Clone for Struct_a {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_a() {
assert_eq!(::std::mem::size_of::<Struct_a>() , 8usize);
assert_eq!(::std::mem::align_of::<Struct_a>() , 8usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_b {
pub val_b: ::std::os::raw::c_int,
}
impl ::std::clone::Clone for Struct_b {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_b() {
assert_eq!(::std::mem::size_of::<Struct_b>() , 4usize);
assert_eq!(::std::mem::align_of::<Struct_b>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_a {
pub val_a: *mut Struct_b,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_b {
pub val_b: ::std::os::raw::c_int,
}
thread 'test_struct::containing_fwd_decl_struct' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::packed_struct stdout ----
Generated bindings for headers/struct_with_packing.h do not match the reference bindings.
Generated:
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct Struct_a {
pub b: ::std::os::raw::c_char,
pub c: ::std::os::raw::c_short,
}
impl ::std::clone::Clone for Struct_a {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_a() {
assert_eq!(::std::mem::size_of::<Struct_a>() , 3usize);
assert_eq!(::std::mem::align_of::<Struct_a>() , 1usize);
}
Reference:
#[repr(C, packed)]
#[derive(Copy, Clone)]
pub struct Struct_a {
pub b: ::std::os::raw::c_char,
pub c: ::std::os::raw::c_short,
}
thread 'test_struct::packed_struct' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::with_anon_struct_pointer stdout ----
Generated bindings for headers/struct_with_anon_struct_pointer.h do not match the reference bindings.
Generated:
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo {
pub bar: *mut Struct_foo_struct_with_anon_struct_pointer_h_unnamed_1,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo_struct_with_anon_struct_pointer_h_unnamed_1 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
impl ::std::clone::Clone for
Struct_foo_struct_with_anon_struct_pointer_h_unnamed_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo_struct_with_anon_struct_pointer_h_unnamed_1() {
assert_eq!(::std::mem::size_of::<Struct_foo_struct_with_anon_struct_pointer_h_unnamed_1>()
, 8usize);
assert_eq!(::std::mem::align_of::<Struct_foo_struct_with_anon_struct_pointer_h_unnamed_1>()
, 4usize);
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo() {
assert_eq!(::std::mem::size_of::<Struct_foo>() , 8usize);
assert_eq!(::std::mem::align_of::<Struct_foo>() , 8usize);
}
Reference:
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_foo {
pub bar: *mut Struct_struct_with_anon_struct_pointer_h_unnamed_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_struct_with_anon_struct_pointer_h_unnamed_1 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
thread 'test_struct::with_anon_struct_pointer' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::with_anon_struct stdout ----
Generated bindings for headers/struct_with_anon_struct.h do not match the reference bindings.
Generated:
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo {
pub bar: Struct_foo_struct_with_anon_struct_h_unnamed_4,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo_struct_with_anon_struct_h_unnamed_4 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
impl ::std::clone::Clone for Struct_foo_struct_with_anon_struct_h_unnamed_4 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo_struct_with_anon_struct_h_unnamed_4() {
assert_eq!(::std::mem::size_of::<Struct_foo_struct_with_anon_struct_h_unnamed_4>()
, 8usize);
assert_eq!(::std::mem::align_of::<Struct_foo_struct_with_anon_struct_h_unnamed_4>()
, 4usize);
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo() {
assert_eq!(::std::mem::size_of::<Struct_foo>() , 8usize);
assert_eq!(::std::mem::align_of::<Struct_foo>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_foo {
pub bar: Struct_struct_with_anon_struct_h_unnamed_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_struct_with_anon_struct_h_unnamed_1 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
thread 'test_struct::with_anon_struct' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::with_anon_struct_array stdout ----
Generated bindings for headers/struct_with_anon_struct_array.h do not match the reference bindings.
Generated:
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo {
pub bar: [Struct_foo_struct_with_anon_struct_array_h_unnamed_2; 2usize],
pub baz: [[[Struct_foo_struct_with_anon_struct_array_h_unnamed_3; 4usize]; 3usize]; 2usize],
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo_struct_with_anon_struct_array_h_unnamed_2 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
impl ::std::clone::Clone for
Struct_foo_struct_with_anon_struct_array_h_unnamed_2 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo_struct_with_anon_struct_array_h_unnamed_2() {
assert_eq!(::std::mem::size_of::<Struct_foo_struct_with_anon_struct_array_h_unnamed_2>()
, 8usize);
assert_eq!(::std::mem::align_of::<Struct_foo_struct_with_anon_struct_array_h_unnamed_2>()
, 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo_struct_with_anon_struct_array_h_unnamed_3 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
impl ::std::clone::Clone for
Struct_foo_struct_with_anon_struct_array_h_unnamed_3 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo_struct_with_anon_struct_array_h_unnamed_3() {
assert_eq!(::std::mem::size_of::<Struct_foo_struct_with_anon_struct_array_h_unnamed_3>()
, 8usize);
assert_eq!(::std::mem::align_of::<Struct_foo_struct_with_anon_struct_array_h_unnamed_3>()
, 4usize);
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo() {
assert_eq!(::std::mem::size_of::<Struct_foo>() , 208usize);
assert_eq!(::std::mem::align_of::<Struct_foo>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_foo {
pub bar: [Struct_struct_with_anon_struct_array_h_unnamed_1; 2usize],
pub baz: [[[Struct_struct_with_anon_struct_array_h_unnamed_2; 4usize]; 3usize]; 2usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_struct_with_anon_struct_array_h_unnamed_1 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_struct_with_anon_struct_array_h_unnamed_2 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
thread 'test_struct::with_anon_struct_array' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::with_anon_unnamed_struct stdout ----
Generated bindings for headers/struct_with_anon_unnamed_struct.h do not match the reference bindings.
Generated:
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo {
pub foo_struct_with_anon_unnamed_struct_h_unnamed_7: Struct_foo_struct_with_anon_unnamed_struct_h_unnamed_7,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo_struct_with_anon_unnamed_struct_h_unnamed_7 {
pub a: ::std::os::raw::c_uint,
pub b: ::std::os::raw::c_uint,
}
impl ::std::clone::Clone for
Struct_foo_struct_with_anon_unnamed_struct_h_unnamed_7 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo_struct_with_anon_unnamed_struct_h_unnamed_7() {
assert_eq!(::std::mem::size_of::<Struct_foo_struct_with_anon_unnamed_struct_h_unnamed_7>()
, 8usize);
assert_eq!(::std::mem::align_of::<Struct_foo_struct_with_anon_unnamed_struct_h_unnamed_7>()
, 4usize);
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo() {
assert_eq!(::std::mem::size_of::<Struct_foo>() , 8usize);
assert_eq!(::std::mem::align_of::<Struct_foo>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Struct_foo {
pub _bindgen_data_1_: [u32; 2usize],
}
impl Struct_foo {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(4))
}
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_struct::with_anon_unnamed_struct' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::with_anon_union stdout ----
Generated bindings for headers/struct_with_anon_union.h do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo {
pub bar: Union_foo_struct_with_anon_union_h_unnamed_5,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo_struct_with_anon_union_h_unnamed_5 {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub b: __BindgenUnionField<::std::os::raw::c_ushort>,
pub _bindgen_data_: u32,
}
impl Union_foo_struct_with_anon_union_h_unnamed_5 {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo_struct_with_anon_union_h_unnamed_5 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo_struct_with_anon_union_h_unnamed_5() {
assert_eq!(::std::mem::size_of::<Union_foo_struct_with_anon_union_h_unnamed_5>()
, 4usize);
assert_eq!(::std::mem::align_of::<Union_foo_struct_with_anon_union_h_unnamed_5>()
, 4usize);
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo() {
assert_eq!(::std::mem::size_of::<Struct_foo>() , 4usize);
assert_eq!(::std::mem::align_of::<Struct_foo>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_foo {
pub bar: Union_unnamed1,
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
pub struct Union_unnamed1 {
pub _bindgen_data_: [u32; 1usize],
}
impl Union_unnamed1 {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
thread 'test_struct::with_anon_union' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::with_anon_unnamed_union stdout ----
Generated bindings for headers/struct_with_anon_unnamed_union.h do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo {
pub foo_struct_with_anon_unnamed_union_h_unnamed_6: Union_foo_struct_with_anon_unnamed_union_h_unnamed_6,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo_struct_with_anon_unnamed_union_h_unnamed_6 {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub b: __BindgenUnionField<::std::os::raw::c_ushort>,
pub _bindgen_data_: u32,
}
impl Union_foo_struct_with_anon_unnamed_union_h_unnamed_6 {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for
Union_foo_struct_with_anon_unnamed_union_h_unnamed_6 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo_struct_with_anon_unnamed_union_h_unnamed_6() {
assert_eq!(::std::mem::size_of::<Union_foo_struct_with_anon_unnamed_union_h_unnamed_6>()
, 4usize);
assert_eq!(::std::mem::align_of::<Union_foo_struct_with_anon_unnamed_union_h_unnamed_6>()
, 4usize);
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo() {
assert_eq!(::std::mem::size_of::<Struct_foo>() , 4usize);
assert_eq!(::std::mem::align_of::<Struct_foo>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_foo {
pub _bindgen_data_1_: [u32; 1usize],
}
impl Struct_foo {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_struct::with_anon_unnamed_union' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::with_fwd_decl_struct stdout ----
Generated bindings for headers/forward_declared_struct.h do not match the reference bindings.
Generated:
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_a {
pub b: ::std::os::raw::c_int,
}
impl ::std::clone::Clone for Struct_a {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_a() {
assert_eq!(::std::mem::size_of::<Struct_a>() , 4usize);
assert_eq!(::std::mem::align_of::<Struct_a>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_c {
pub d: ::std::os::raw::c_int,
}
impl ::std::clone::Clone for Struct_c {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_c() {
assert_eq!(::std::mem::size_of::<Struct_c>() , 4usize);
assert_eq!(::std::mem::align_of::<Struct_c>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_a {
pub b: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct_c {
pub d: ::std::os::raw::c_int,
}
thread 'test_struct::with_fwd_decl_struct' panicked at 'explicit panic', tests/support.rs:66
---- test_union::with_anon_struct stdout ----
Generated bindings for headers/union_with_anon_struct.h do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo {
pub bar: __BindgenUnionField<Struct_foo_union_with_anon_struct_h_unnamed_10>,
pub _bindgen_data_: [u32; 2usize],
}
impl Union_foo {
pub unsafe fn bar(&mut self)
-> *mut Struct_foo_union_with_anon_struct_h_unnamed_10 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo() {
assert_eq!(::std::mem::size_of::<Union_foo>() , 8usize);
assert_eq!(::std::mem::align_of::<Union_foo>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo_union_with_anon_struct_h_unnamed_10 {
pub a: ::std::os::raw::c_uint,
pub b: ::std::os::raw::c_uint,
}
impl ::std::clone::Clone for Struct_foo_union_with_anon_struct_h_unnamed_10 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo_union_with_anon_struct_h_unnamed_10() {
assert_eq!(::std::mem::size_of::<Struct_foo_union_with_anon_struct_h_unnamed_10>()
, 8usize);
assert_eq!(::std::mem::align_of::<Struct_foo_union_with_anon_struct_h_unnamed_10>()
, 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Union_foo {
pub _bindgen_data_: [u32; 2usize],
}
impl Union_foo {
pub unsafe fn bar(&mut self) -> *mut Struct_Unnamed1 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Union_foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Struct_Unnamed1 {
pub a: ::std::os::raw::c_uint,
pub b: ::std::os::raw::c_uint,
}
impl ::std::clone::Clone for Struct_Unnamed1 {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_Unnamed1 {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_union::with_anon_struct' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::with_bitfields stdout ----
Generated bindings for headers/struct_with_bitfields.h do not match the reference bindings.
Generated:
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_bitfield {
pub _bitfield_1: ::std::os::raw::c_ushort,
pub e: ::std::os::raw::c_int,
pub _bitfield_2: ::std::os::raw::c_uint,
pub _bitfield_3: ::std::os::raw::c_uint,
}
impl Struct_bitfield {
#[inline]
pub fn a(&self) -> ::std::os::raw::c_ushort {
(self._bitfield_1 & (1usize as ::std::os::raw::c_ushort)) >> 0usize
}
#[inline]
pub fn set_a(&mut self, val: bool) {
self._bitfield_1 &= !(1usize as ::std::os::raw::c_ushort);
self._bitfield_1 |=
((val as ::std::os::raw::c_ushort) << 0usize) &
(1usize as ::std::os::raw::c_ushort);
}
#[inline]
pub fn b(&self) -> ::std::os::raw::c_ushort {
(self._bitfield_1 & (2usize as ::std::os::raw::c_ushort)) >> 1usize
}
#[inline]
pub fn set_b(&mut self, val: bool) {
self._bitfield_1 &= !(2usize as ::std::os::raw::c_ushort);
self._bitfield_1 |=
((val as ::std::os::raw::c_ushort) << 1usize) &
(2usize as ::std::os::raw::c_ushort);
}
#[inline]
pub fn c(&self) -> ::std::os::raw::c_ushort {
(self._bitfield_1 & (4usize as ::std::os::raw::c_ushort)) >> 2usize
}
#[inline]
pub fn set_c(&mut self, val: bool) {
self._bitfield_1 &= !(4usize as ::std::os::raw::c_ushort);
self._bitfield_1 |=
((val as ::std::os::raw::c_ushort) << 2usize) &
(4usize as ::std::os::raw::c_ushort);
}
#[inline]
pub fn at_offset_3(&self) -> ::std::os::raw::c_ushort {
(self._bitfield_1 & (8usize as ::std::os::raw::c_ushort)) >> 3usize
}
#[inline]
pub fn set_at_offset_3(&mut self, val: bool) {
self._bitfield_1 &= !(8usize as ::std::os::raw::c_ushort);
self._bitfield_1 |=
((val as ::std::os::raw::c_ushort) << 3usize) &
(8usize as ::std::os::raw::c_ushort);
}
#[inline]
pub fn at_offset_4(&self) -> ::std::os::raw::c_ushort {
(self._bitfield_1 & (48usize as ::std::os::raw::c_ushort)) >> 4usize
}
#[inline]
pub fn set_at_offset_4(&mut self, val: u8) {
self._bitfield_1 &= !(48usize as ::std::os::raw::c_ushort);
self._bitfield_1 |=
((val as ::std::os::raw::c_ushort) << 4usize) &
(48usize as ::std::os::raw::c_ushort);
}
#[inline]
pub fn d(&self) -> ::std::os::raw::c_ushort {
(self._bitfield_1 & (192usize as ::std::os::raw::c_ushort)) >> 6usize
}
#[inline]
pub fn set_d(&mut self, val: u8) {
self._bitfield_1 &= !(192usize as ::std::os::raw::c_ushort);
self._bitfield_1 |=
((val as ::std::os::raw::c_ushort) << 6usize) &
(192usize as ::std::os::raw::c_ushort);
}
pub const fn new_bitfield_1(a: bool, b: bool, c: bool,
unnamed_bitfield1: bool,
unnamed_bitfield2: u8, d: u8)
-> ::std::os::raw::c_ushort {
0 | ((a as ::std::os::raw::c_ushort) << 0u32) |
((b as ::std::os::raw::c_ushort) << 1u32) |
((c as ::std::os::raw::c_ushort) << 2u32) |
((unnamed_bitfield1 as ::std::os::raw::c_ushort) << 3u32) |
((unnamed_bitfield2 as ::std::os::raw::c_ushort) << 4u32) |
((d as ::std::os::raw::c_ushort) << 6u32)
}
#[inline]
pub fn f(&self) -> ::std::os::raw::c_uint {
(self._bitfield_2 & (3usize as ::std::os::raw::c_uint)) >> 0usize
}
#[inline]
pub fn set_f(&mut self, val: u8) {
self._bitfield_2 &= !(3usize as ::std::os::raw::c_uint);
self._bitfield_2 |=
((val as ::std::os::raw::c_uint) << 0usize) &
(3usize as ::std::os::raw::c_uint);
}
pub const fn new_bitfield_2(f: u8) -> ::std::os::raw::c_uint {
0 | ((f as ::std::os::raw::c_uint) << 0u32)
}
#[inline]
pub fn g(&self) -> ::std::os::raw::c_uint {
(self._bitfield_3 & (4294967295usize as ::std::os::raw::c_uint)) >>
0usize
}
#[inline]
pub fn set_g(&mut self, val: u32) {
self._bitfield_3 &= !(4294967295usize as ::std::os::raw::c_uint);
self._bitfield_3 |=
((val as ::std::os::raw::c_uint) << 0usize) &
(4294967295usize as ::std::os::raw::c_uint);
}
pub const fn new_bitfield_3(g: u32) -> ::std::os::raw::c_uint {
0 | ((g as ::std::os::raw::c_uint) << 0u32)
}
}
impl ::std::clone::Clone for Struct_bitfield {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_bitfield() {
assert_eq!(::std::mem::size_of::<Struct_bitfield>() , 16usize);
assert_eq!(::std::mem::align_of::<Struct_bitfield>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Struct_bitfield {
pub _bindgen_bitfield_1_: ::std::os::raw::c_ushort,
pub e: ::std::os::raw::c_int,
pub _bindgen_bitfield_2_: ::std::os::raw::c_uint,
pub _bindgen_bitfield_3_: ::std::os::raw::c_uint,
}
impl ::std::clone::Clone for Struct_bitfield {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_bitfield {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_struct::with_bitfields' panicked at 'explicit panic', tests/support.rs:66
---- test_union::with_anon_struct_bitfield stdout ----
Generated bindings for headers/union_with_anon_struct_bitfield.h do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo {
pub a: __BindgenUnionField<::std::os::raw::c_int>,
pub foo_union_with_anon_struct_bitfield_h_unnamed_12: __BindgenUnionField<Struct_foo_union_with_anon_struct_bitfield_h_unnamed_12>,
pub _bindgen_data_: u32,
}
impl Union_foo {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_int {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn foo_union_with_anon_struct_bitfield_h_unnamed_12(&mut self)
-> *mut Struct_foo_union_with_anon_struct_bitfield_h_unnamed_12 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo() {
assert_eq!(::std::mem::size_of::<Union_foo>() , 4usize);
assert_eq!(::std::mem::align_of::<Union_foo>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo_union_with_anon_struct_bitfield_h_unnamed_12 {
pub _bitfield_1: ::std::os::raw::c_int,
}
impl Struct_foo_union_with_anon_struct_bitfield_h_unnamed_12 {
#[inline]
pub fn b(&self) -> ::std::os::raw::c_int {
(self._bitfield_1 & (127usize as ::std::os::raw::c_int)) >> 0usize
}
#[inline]
pub fn set_b(&mut self, val: u8) {
self._bitfield_1 &= !(127usize as ::std::os::raw::c_int);
self._bitfield_1 |=
((val as ::std::os::raw::c_int) << 0usize) &
(127usize as ::std::os::raw::c_int);
}
#[inline]
pub fn c(&self) -> ::std::os::raw::c_int {
(self._bitfield_1 & (4294967168usize as ::std::os::raw::c_int)) >>
7usize
}
#[inline]
pub fn set_c(&mut self, val: u32) {
self._bitfield_1 &= !(4294967168usize as ::std::os::raw::c_int);
self._bitfield_1 |=
((val as ::std::os::raw::c_int) << 7usize) &
(4294967168usize as ::std::os::raw::c_int);
}
pub const fn new_bitfield_1(b: u8, c: u32) -> ::std::os::raw::c_int {
0 | ((b as ::std::os::raw::c_int) << 0u32) |
((c as ::std::os::raw::c_int) << 7u32)
}
}
impl ::std::clone::Clone for
Struct_foo_union_with_anon_struct_bitfield_h_unnamed_12 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo_union_with_anon_struct_bitfield_h_unnamed_12() {
assert_eq!(::std::mem::size_of::<Struct_foo_union_with_anon_struct_bitfield_h_unnamed_12>()
, 4usize);
assert_eq!(::std::mem::align_of::<Struct_foo_union_with_anon_struct_bitfield_h_unnamed_12>()
, 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Union_foo {
pub _bindgen_data_: [u32; 1usize],
}
impl Union_foo {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_int {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Union_foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_union::with_anon_struct_bitfield' panicked at 'explicit panic', tests/support.rs:66
---- test_union::with_anon_union stdout ----
Generated bindings for headers/union_with_anon_union.h do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo {
pub bar: __BindgenUnionField<Union_foo_union_with_anon_union_h_unnamed_13>,
pub _bindgen_data_: u32,
}
impl Union_foo {
pub unsafe fn bar(&mut self)
-> *mut Union_foo_union_with_anon_union_h_unnamed_13 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo() {
assert_eq!(::std::mem::size_of::<Union_foo>() , 4usize);
assert_eq!(::std::mem::align_of::<Union_foo>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo_union_with_anon_union_h_unnamed_13 {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub b: __BindgenUnionField<::std::os::raw::c_ushort>,
pub _bindgen_data_: u32,
}
impl Union_foo_union_with_anon_union_h_unnamed_13 {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo_union_with_anon_union_h_unnamed_13 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo_union_with_anon_union_h_unnamed_13() {
assert_eq!(::std::mem::size_of::<Union_foo_union_with_anon_union_h_unnamed_13>()
, 4usize);
assert_eq!(::std::mem::align_of::<Union_foo_union_with_anon_union_h_unnamed_13>()
, 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Union_foo {
pub _bindgen_data_: [u32; 1usize],
}
impl Union_foo {
pub unsafe fn bar(&mut self) -> *mut Union_Unnamed1 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Union_foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Union_Unnamed1 {
pub _bindgen_data_: [u32; 1usize],
}
impl Union_Unnamed1 {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_Unnamed1 {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Union_Unnamed1 {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_union::with_anon_union' panicked at 'explicit panic', tests/support.rs:66
---- test_union::with_anon_unnamed_struct stdout ----
Generated bindings for headers/union_with_anon_unnamed_struct.h do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_pixel {
pub rgba: __BindgenUnionField<::std::os::raw::c_uint>,
pub pixel_union_with_anon_unnamed_struct_h_unnamed_14: __BindgenUnionField<Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_14>,
pub _bindgen_data_: u32,
}
impl Union_pixel {
pub unsafe fn rgba(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn pixel_union_with_anon_unnamed_struct_h_unnamed_14(&mut self)
-> *mut Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_14 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_pixel {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_pixel() {
assert_eq!(::std::mem::size_of::<Union_pixel>() , 4usize);
assert_eq!(::std::mem::align_of::<Union_pixel>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_14 {
pub r: ::std::os::raw::c_uchar,
pub g: ::std::os::raw::c_uchar,
pub b: ::std::os::raw::c_uchar,
pub a: ::std::os::raw::c_uchar,
}
impl ::std::clone::Clone for
Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_14 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_14() {
assert_eq!(::std::mem::size_of::<Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_14>()
, 4usize);
assert_eq!(::std::mem::align_of::<Struct_pixel_union_with_anon_unnamed_struct_h_unnamed_14>()
, 1usize);
}
Reference:
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Union_pixel {
pub _bindgen_data_: [u32; 1usize],
}
impl Union_pixel {
pub unsafe fn rgba(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn r(&mut self) -> *mut ::std::os::raw::c_uchar {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn g(&mut self) -> *mut ::std::os::raw::c_uchar {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(1))
}
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_uchar {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(2))
}
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uchar {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(3))
}
}
impl ::std::clone::Clone for Union_pixel {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Union_pixel {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_union::with_anon_unnamed_struct' panicked at 'explicit panic', tests/support.rs:66
---- test_struct::with_nesting stdout ----
Generated bindings for headers/struct_with_nesting.h do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo {
pub a: ::std::os::raw::c_uint,
pub foo_struct_with_nesting_h_unnamed_8: Union_foo_struct_with_nesting_h_unnamed_8,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo_struct_with_nesting_h_unnamed_8 {
pub b: __BindgenUnionField<::std::os::raw::c_uint>,
pub foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_9: __BindgenUnionField<Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_9>,
pub foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_11: __BindgenUnionField<Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_11>,
pub _bindgen_data_: u32,
}
impl Union_foo_struct_with_nesting_h_unnamed_8 {
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_9(&mut self)
->
*mut Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_9 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_11(&mut self)
->
*mut Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_11 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo_struct_with_nesting_h_unnamed_8 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo_struct_with_nesting_h_unnamed_8() {
assert_eq!(::std::mem::size_of::<Union_foo_struct_with_nesting_h_unnamed_8>()
, 4usize);
assert_eq!(::std::mem::align_of::<Union_foo_struct_with_nesting_h_unnamed_8>()
, 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_9 {
pub c1: ::std::os::raw::c_ushort,
pub c2: ::std::os::raw::c_ushort,
}
impl ::std::clone::Clone for
Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_9 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_9() {
assert_eq!(::std::mem::size_of::<Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_9>()
, 4usize);
assert_eq!(::std::mem::align_of::<Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_9>()
, 2usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_11 {
pub d1: ::std::os::raw::c_uchar,
pub d2: ::std::os::raw::c_uchar,
pub d3: ::std::os::raw::c_uchar,
pub d4: ::std::os::raw::c_uchar,
}
impl ::std::clone::Clone for
Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_11 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_11() {
assert_eq!(::std::mem::size_of::<Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_11>()
, 4usize);
assert_eq!(::std::mem::align_of::<Struct_foo_struct_with_nesting_h_unnamed_8_struct_with_nesting_h_unnamed_11>()
, 1usize);
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo() {
assert_eq!(::std::mem::size_of::<Struct_foo>() , 8usize);
assert_eq!(::std::mem::align_of::<Struct_foo>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Struct_foo {
pub a: ::std::os::raw::c_uint,
pub _bindgen_data_1_: [u32; 1usize],
}
impl Struct_foo {
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn c1(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn c2(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(2))
}
pub unsafe fn d1(&mut self) -> *mut ::std::os::raw::c_uchar {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn d2(&mut self) -> *mut ::std::os::raw::c_uchar {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(1))
}
pub unsafe fn d3(&mut self) -> *mut ::std::os::raw::c_uchar {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(2))
}
pub unsafe fn d4(&mut self) -> *mut ::std::os::raw::c_uchar {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_1_);
::std::mem::transmute(raw.offset(3))
}
}
impl ::std::clone::Clone for Struct_foo {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Struct_foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_struct::with_nesting' panicked at 'explicit panic', tests/support.rs:66
---- test_union::with_anon_unnamed_union stdout ----
Generated bindings for headers/union_with_anon_unnamed_union.h do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub foo_union_with_anon_unnamed_union_h_unnamed_15: __BindgenUnionField<Union_foo_union_with_anon_unnamed_union_h_unnamed_15>,
pub _bindgen_data_: u32,
}
impl Union_foo {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn foo_union_with_anon_unnamed_union_h_unnamed_15(&mut self)
-> *mut Union_foo_union_with_anon_unnamed_union_h_unnamed_15 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo() {
assert_eq!(::std::mem::size_of::<Union_foo>() , 4usize);
assert_eq!(::std::mem::align_of::<Union_foo>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo_union_with_anon_unnamed_union_h_unnamed_15 {
pub b: __BindgenUnionField<::std::os::raw::c_ushort>,
pub c: __BindgenUnionField<::std::os::raw::c_uchar>,
pub _bindgen_data_: u16,
}
impl Union_foo_union_with_anon_unnamed_union_h_unnamed_15 {
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn c(&mut self) -> *mut ::std::os::raw::c_uchar {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for
Union_foo_union_with_anon_unnamed_union_h_unnamed_15 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo_union_with_anon_unnamed_union_h_unnamed_15() {
assert_eq!(::std::mem::size_of::<Union_foo_union_with_anon_unnamed_union_h_unnamed_15>()
, 2usize);
assert_eq!(::std::mem::align_of::<Union_foo_union_with_anon_unnamed_union_h_unnamed_15>()
, 2usize);
}
Reference:
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Union_foo {
pub _bindgen_data_: [u32; 1usize],
}
impl Union_foo {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn c(&mut self) -> *mut ::std::os::raw::c_uchar {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Union_foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_union::with_anon_unnamed_union' panicked at 'explicit panic', tests/support.rs:66
---- test_union::with_derive_debug stdout ----
Generated bindings for headers/union_with_big_member.h do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Copy)]
pub struct Union_WithBigArray {
pub a: __BindgenUnionField<::std::os::raw::c_int>,
pub b: __BindgenUnionField<[::std::os::raw::c_int; 33usize]>,
pub _bindgen_data_: [u32; 33usize],
}
impl Union_WithBigArray {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_int {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut [::std::os::raw::c_int; 33usize] {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_WithBigArray {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_WithBigArray() {
assert_eq!(::std::mem::size_of::<Union_WithBigArray>() , 132usize);
assert_eq!(::std::mem::align_of::<Union_WithBigArray>() , 4usize);
}
#[repr(C)]
#[derive(Copy)]
pub struct Union_WithBigMember {
pub a: __BindgenUnionField<::std::os::raw::c_int>,
pub b: __BindgenUnionField<Union_WithBigArray>,
pub _bindgen_data_: [u32; 33usize],
}
impl Union_WithBigMember {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_int {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut Union_WithBigArray {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_WithBigMember {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_WithBigMember() {
assert_eq!(::std::mem::size_of::<Union_WithBigMember>() , 132usize);
assert_eq!(::std::mem::align_of::<Union_WithBigMember>() , 4usize);
}
Reference:
#[repr(C)]
#[derive(Copy)]
pub struct Union_WithBigArray {
pub _bindgen_data_: [u32; 33usize],
}
impl Union_WithBigArray {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_int {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut [::std::os::raw::c_int; 33usize] {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_WithBigArray {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Union_WithBigArray {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Copy)]
pub struct Union_WithBigMember {
pub _bindgen_data_: [u32; 33usize],
}
impl Union_WithBigMember {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_int {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b(&mut self) -> *mut Union_WithBigArray {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_WithBigMember {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Union_WithBigMember {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_union::with_derive_debug' panicked at 'explicit panic', tests/support.rs:66
---- test_union::with_nesting stdout ----
Generated bindings for headers/union_with_nesting.h do not match the reference bindings.
Generated:
#[derive(Copy, Debug)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub foo_union_with_nesting_h_unnamed_16: __BindgenUnionField<Struct_foo_union_with_nesting_h_unnamed_16>,
pub _bindgen_data_: u32,
}
impl Union_foo {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn foo_union_with_nesting_h_unnamed_16(&mut self)
-> *mut Struct_foo_union_with_nesting_h_unnamed_16 {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for Union_foo {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo() {
assert_eq!(::std::mem::size_of::<Union_foo>() , 4usize);
assert_eq!(::std::mem::align_of::<Union_foo>() , 4usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Struct_foo_union_with_nesting_h_unnamed_16 {
pub foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_17: Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_17,
pub foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_18: Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_18,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_17 {
pub b1: __BindgenUnionField<::std::os::raw::c_ushort>,
pub b2: __BindgenUnionField<::std::os::raw::c_ushort>,
pub _bindgen_data_: u16,
}
impl Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_17
{
pub unsafe fn b1(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b2(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for
Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_17 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_17() {
assert_eq!(::std::mem::size_of::<Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_17>()
, 2usize);
assert_eq!(::std::mem::align_of::<Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_17>()
, 2usize);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_18 {
pub c1: __BindgenUnionField<::std::os::raw::c_ushort>,
pub c2: __BindgenUnionField<::std::os::raw::c_ushort>,
pub _bindgen_data_: u16,
}
impl Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_18
{
pub unsafe fn c1(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn c2(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
}
impl ::std::clone::Clone for
Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_18 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_18() {
assert_eq!(::std::mem::size_of::<Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_18>()
, 2usize);
assert_eq!(::std::mem::align_of::<Union_foo_union_with_nesting_h_unnamed_16_union_with_nesting_h_unnamed_18>()
, 2usize);
}
impl ::std::clone::Clone for Struct_foo_union_with_nesting_h_unnamed_16 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_Struct_foo_union_with_nesting_h_unnamed_16() {
assert_eq!(::std::mem::size_of::<Struct_foo_union_with_nesting_h_unnamed_16>()
, 4usize);
assert_eq!(::std::mem::align_of::<Struct_foo_union_with_nesting_h_unnamed_16>()
, 2usize);
}
Reference:
#[repr(C)]
#[derive(Copy)]
#[derive(Debug)]
pub struct Union_foo {
pub _bindgen_data_: [u32; 1usize],
}
impl Union_foo {
pub unsafe fn a(&mut self) -> *mut ::std::os::raw::c_uint {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b1(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn b2(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(0))
}
pub unsafe fn c1(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(2))
}
pub unsafe fn c2(&mut self) -> *mut ::std::os::raw::c_ushort {
let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
::std::mem::transmute(raw.offset(2))
}
}
impl ::std::clone::Clone for Union_foo {
fn clone(&self) -> Self { *self }
}
impl ::std::default::Default for Union_foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'test_union::with_nesting' panicked at 'explicit panic', tests/support.rs:66
failures:
test_builtins::test_builtin_va_list
test_cxx::test_cxx_class
test_cxx::test_cxx_template
test_enum::with_duplicate_enum_value
test_enum::with_explicitly_typed_cxx_enum
test_enum::with_overflowed_enum_value
test_enum::with_packed_enums
test_enum::with_simple_enum
test_func::func_ptr_in_struct
test_struct::containing_fwd_decl_struct
test_struct::packed_struct
test_struct::with_anon_struct
test_struct::with_anon_struct_array
test_struct::with_anon_struct_pointer
test_struct::with_anon_union
test_struct::with_anon_unnamed_struct
test_struct::with_anon_unnamed_union
test_struct::with_bitfields
test_struct::with_fwd_decl_struct
test_struct::with_nesting
test_union::with_anon_struct
test_union::with_anon_struct_bitfield
test_union::with_anon_union
test_union::with_anon_unnamed_struct
test_union::with_anon_unnamed_union
test_union::with_derive_debug
test_union::with_nesting
test result: FAILED. 6 passed; 27 failed; 0 ignored; 0 measured
error: test failed