Skip to content

Instantly share code, notes, and snippets.

@pepyakin
Created October 9, 2017 17:55
Show Gist options
  • Save pepyakin/7627b1dc2fd89445baad92bff8ce1b6d to your computer and use it in GitHub Desktop.
Save pepyakin/7627b1dc2fd89445baad92bff8ce1b6d to your computer and use it in GitHub Desktop.
Test failures on current master
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running target/debug/deps/bindgen-0e79f9c99fbeae2f
running 17 tests
test codegen::struct_layout::test_align_to ... ok
test codegen::struct_layout::test_bytes_from_bits_pow2 ... ok
test features::test::str_to_target ... ok
test ir::comment::test::picks_up_single_and_multi_line_doc_comments ... ok
test ir::layout::test_layout_for_size ... ok
test ir::comment::test::processes_single_lines_correctly ... ok
test ir::comment::test::processes_multi_lines_correctly ... ok
test ir::traversal::tests::traversal_predicate_is_object_safe ... ok
test ir::ty::is_invalid_type_param_empty_name ... ok
test commandline_flag_unit_test_function ... ok
test ir::ty::is_invalid_type_param_invalid_remaing ... ok
test ir::ty::is_invalid_type_param_invalid_start ... ok
test ir::ty::is_invalid_type_param_valid ... ok
test ir::ty::is_invalid_type_param_valid_underscore_and_numbers ... ok
test ir::ty::is_invalid_type_param_valid_unnamed_kind ... ok
test ir::ty::is_invalid_type_param_unnamed ... ok
test ir::analysis::tests::monotone ... ok
test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/bindgen-0cb47285f1ebca95
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/stylo_sanity-229225612c93ab87
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/tests-e442cb02945988d5
running 372 tests
test dump_preprocessed_input ... ok
test header_381_decltype_alias_hpp ... ok
test header_annotation_hide_hpp ... ok
test header_anon_enum_trait_hpp ... ok
test header_anon_enum_hpp ... ok
test header_accessors_hpp ... ok
test header_16_byte_alignment_h ... ok
test header_16_byte_alignment_1_0_h ... ok
test header_anon_enum_whitelist_h ... ok
test header_anon_struct_in_union_h ... ok
test header_anon_struct_in_union_1_0_h ... ok
test header_arg_keyword_hpp ... FAILED
test header_anon_union_1_0_hpp ... ok
test header_anonymous_template_types_hpp ... ok
test header_anon_union_hpp ... ok
test header_auto_hpp ... FAILED
test header_base_to_derived_hpp ... ok
test header_bad_namespace_parenthood_inheritance_hpp ... ok
test header_bitfield_align_2_h ... ok
test header_bitfield_large_hpp ... ok
test header_bitfield_enum_basic_hpp ... ok
test header_bitfield_large_overflow_hpp ... FAILED
test header_bitfield_32bit_overflow_h ... ok
test header_call_conv_field_h ... ok
test header_bitfield_align_h ... ok
test header_blacklist_and_impl_debug_hpp ... ok
test header_bitfield_method_mangling_h ... ok
test header_bitfield_method_same_name_hpp ... FAILED
test header_c_empty_layout_h ... ok
test header_builtin_template_hpp ... ok
test header_blocks_h ... FAILED
test header_canonical_path_without_namespacing_hpp ... FAILED
test header_char_h ... ok
test header_class_no_members_hpp ... ok
test header_class_static_const_hpp ... ok
test header_class_static_hpp ... FAILED
test header_class_use_as_hpp ... ok
test header_class_nested_hpp ... FAILED
test header_class_1_0_hpp ... FAILED
test header_class_with_dtor_hpp ... ok
test header_class_hpp ... FAILED
test header_class_with_inner_struct_1_0_hpp ... ok
test header_comment_indent_hpp ... ok
test header_complex_global_h ... FAILED
test header_class_with_inner_struct_hpp ... ok
test header_const_array_fn_arg_h ... FAILED
test header_class_with_typedef_hpp ... FAILED
test header_complex_h ... ok
test header_const_bool_hpp ... ok
test header_const_enum_unnamed_hpp ... ok
test header_const_tparam_hpp ... ok
test header_const_resolved_ty_h ... FAILED
test header_constant_non_specialized_tp_hpp ... ok
test header_constant_evaluate_h ... ok
test header_constify_all_enums_h ... ok
test header_const_ptr_hpp ... FAILED
test header_constify_enum_h ... ok
test header_constructor_tp_hpp ... FAILED
test header_constify_module_enums_namespace_hpp ... ok
test header_constify_module_enums_shadow_name_h ... ok
test header_constify_module_enums_basic_h ... FAILED
test header_constify_module_enums_simple_nonamespace_hpp ... ok
test header_constify_module_enums_simple_alias_hpp ... ok
test header_constructors_hpp ... FAILED
test header_constify_module_enums_types_hpp ... FAILED
test header_cpp_empty_layout_hpp ... ok
test header_decl_ptr_to_array_h ... FAILED
test header_dash_language_h ... ok
test header_decl_extern_int_twice_h ... FAILED
test header_convert_floats_h ... ok
test header_crtp_hpp ... ok
test header_convert_cpp_comment_to_rust_hpp ... ok
test header_default_template_parameter_hpp ... FAILED
test header_derive_debug_generic_hpp ... ok
test header_derive_debug_bitfield_hpp ... ok
test header_derive_debug_opaque_template_instantiation_hpp ... ok
test header_derive_debug_function_pointer_hpp ... ok
test header_derive_debug_opaque_hpp ... ok
test header_derive_default_and_blacklist_hpp ... ok
test header_derive_bitfield_method_same_name_hpp ... FAILED
test header_derive_fn_ptr_h ... ok
test header_derive_hash_and_blacklist_hpp ... ok
test header_derive_hash_blacklisting_hpp ... ok
test header_derive_hash_struct_with_float_array_h ... ok
test header_derive_hash_struct_with_anon_struct_float_h ... ok
test header_derive_hash_template_def_float_hpp ... ok
test header_derive_hash_struct_with_pointer_h ... ok
test header_derive_hash_template_inst_float_hpp ... ok
test header_derive_partialeq_and_blacklist_hpp ... ok
test header_derive_partialeq_base_hpp ... ok
test header_derive_partialeq_pointer_hpp ... ok
test header_derive_partialeq_anonfield_h ... ok
test header_derive_partialeq_union_hpp ... ok
test header_derive_partialeq_bitfield_hpp ... ok
test header_derive_partialeq_core_h ... ok
test header_derive_partialeq_union_1_0_hpp ... ok
test header_disable_namespacing_hpp ... ok
test header_do_not_derive_copy_hpp ... ok
test header_doggo_or_null_hpp ... ok
test header_duplicated_constants_in_ns_hpp ... ok
test header_elaborated_hpp ... FAILED
test header_duplicated_namespaces_hpp ... ok
test header_empty_template_param_name_hpp ... ok
test header_duplicated_namespaces_definitions_hpp ... ok
test header_enum_h ... ok
test header_enum_alias_hpp ... ok
test header_enum_dupe_h ... ok
test header_enum_and_vtable_mangling_hpp ... FAILED
test header_enum_explicit_type_hpp ... ok
test header_enum_negative_h ... ok
test header_enum_in_template_with_typedef_hpp ... ok
test header_enum_packed_h ... ok
test header_float128_hpp ... ok
test header_extern_hpp ... ok
test header_forward_declaration_autoptr_hpp ... ok
test header_eval_variadic_template_parameter_hpp ... ok
test header_forward_declared_complex_types_1_0_hpp ... FAILED
test header_forward_enum_decl_hpp ... ok
test header_forward_declared_struct_h ... ok
test header_forward_declared_complex_types_hpp ... FAILED
test header_forward_inherit_struct_hpp ... ok
test header_func_proto_h ... ok
test header_forward_inherit_struct_with_fields_hpp ... ok
test header_func_ptr_h ... FAILED
test header_func_with_func_ptr_arg_h ... FAILED
test header_func_with_array_arg_h ... FAILED
test header_gen_constructors_hpp ... FAILED
test header_func_ptr_in_struct_h ... ok
test header_inherit_namespaced_hpp ... ok
test header_gen_destructors_neg_hpp ... ok
test header_in_class_typedef_hpp ... ok
test header_infinite_macro_h ... ok
test header_gen_destructors_hpp ... FAILED
test header_generate_inline_hpp ... FAILED
test header_inherit_named_hpp ... ok
test header_gen_constructors_neg_hpp ... ok
test header_inline_namespace_no_ns_enabled_hpp ... ok
test header_inline_function_h ... ok
test header_inline_namespace_conservative_hpp ... ok
test header_inherit_typedef_hpp ... ok
test header_inline_namespace_hpp ... ok
test header_inner_template_self_hpp ... ok
test header_inline_namespace_whitelist_hpp ... ok
test header_inner_const_hpp ... FAILED
test header_int128_t_h ... ok
test header_issue_1025_unknown_enum_repr_hpp ... ok
test header_issue_372_hpp ... ok
test header_issue_315_hpp ... ok
test header_issue_311_hpp ... ok
test header_issue_358_hpp ... ok
test header_issue_446_hpp ... ok
test header_issue_410_hpp ... FAILED
test header_issue_573_layout_test_failures_hpp ... ok
test header_issue_569_non_type_template_params_causing_layout_test_failures_hpp ... ok
test header_issue_544_stylo_creduce_hpp ... ok
test header_issue_544_stylo_creduce_2_hpp ... ok
test header_issue_447_hpp ... FAILED
test header_issue_493_1_0_hpp ... ok
test header_issue_493_hpp ... ok
test header_issue_574_assertion_failure_in_codegen_hpp ... FAILED
test header_issue_645_cannot_find_type_t_in_this_scope_hpp ... ok
test header_issue_639_typedef_anon_field_hpp ... ok
test header_issue_643_inner_struct_h ... ok
test header_issue_638_stylo_cannot_find_t_in_this_scope_hpp ... ok
test header_issue_584_stylo_template_analysis_panic_hpp ... FAILED
test header_issue_654_struct_fn_collision_h ... FAILED
test header_issue_648_derive_debug_with_padding_h ... ok
test header_issue_662_cannot_find_t_in_this_scope_hpp ... ok
test header_issue_674_1_hpp ... ok
test header_issue_662_part_2_hpp ... ok
test header_issue_677_nested_ns_specifier_hpp ... ok
test header_issue_691_template_parameter_virtual_hpp ... ok
test header_issue_674_2_hpp ... ok
test header_issue_739_pointer_wide_bitfield_h ... ok
test header_issue_674_3_hpp ... ok
test header_issue_769_bad_instantiation_test_hpp ... ok
test header_issue_833_hpp ... FAILED
test header_issue_833_1_hpp ... FAILED
test header_issue_833_2_hpp ... ok
test header_issue_826_generating_methods_when_asked_not_to_hpp ... ok
test header_issue_820_unused_template_param_in_alias_hpp ... ok
test header_issue_801_opaque_sloppiness_hpp ... FAILED
test header_issue_807_opaque_types_methods_being_generated_hpp ... FAILED
test header_issue_834_hpp ... ok
test header_issue_944_derive_copy_and_blacklisting_hpp ... ok
test header_issue_888_enum_var_decl_jump_hpp ... FAILED
test header_issue_848_replacement_system_include_hpp ... FAILED
test header_layout_align_h ... ok
test header_jsval_layout_opaque_hpp ... ok
test header_jsval_layout_opaque_1_0_hpp ... ok
test header_keywords_h ... FAILED
test header_layout_arp_h ... ok
test header_layout_h ... ok
test header_layout_array_too_long_h ... ok
test header_layout_cmdline_token_h ... ok
test header_layout_array_h ... ok
test header_layout_kni_mbuf_h ... ok
test header_layout_eth_conf_h ... ok
test header_layout_eth_conf_1_0_h ... ok
test header_layout_large_align_field_h ... ok
test header_macro_expr_basic_h ... ok
test header_macro_const_h ... ok
test header_layout_mbuf_1_0_h ... ok
test header_layout_mbuf_h ... ok
test header_macro_expr_uncommon_token_h ... FAILED
test header_macro_redef_h ... ok
test header_maddness_is_avoidable_hpp ... ok
test header_mangling_ios_h ... ok
test header_mangling_linux32_hpp ... ok
test header_mangling_linux64_hpp ... ok
test header_mangling_win32_hpp ... ok
test header_mangling_macos_hpp ... ok
test header_mangling_win64_hpp ... ok
test header_module_whitelisted_hpp ... ok
test header_method_mangling_hpp ... FAILED
test header_msvc_no_usr_hpp ... ok
test header_multiple_inherit_empty_correct_layout_hpp ... ok
test header_mutable_hpp ... ok
test header_nested_hpp ... ok
test header_namespace_hpp ... FAILED
test header_nested_vtable_hpp ... FAILED
test header_no_comments_h ... ok
test header_nested_within_namespace_hpp ... ok
test header_no_copy_hpp ... ok
test header_no_derive_default_h ... ok
test header_no_derive_debug_h ... ok
test header_no_partialeq_opaque_hpp ... ok
test header_no_partialeq_whitelisted_hpp ... ok
test header_no_recursive_whitelisting_h ... ok
test header_no_std_h ... ok
test header_non_type_params_hpp ... ok
test header_nsbasehashtable_hpp ... ok
test header_objc_category_h ... ok
test header_nsstyleautoarray_hpp ... ok
test header_objc_class_h ... FAILED
test header_objc_class_method_h ... ok
test header_objc_interface_h ... ok
test header_objc_method_clash_h ... ok
test header_objc_interface_type_h ... FAILED
test header_objc_protocol_h ... ok
test header_objc_property_fnptr_h ... ok
test header_objc_method_h ... ok
test header_objc_sel_and_id_h ... FAILED
test header_objc_template_h ... ok
test header_objc_whitelist_h ... ok
test header_only_bitfields_hpp ... ok
test header_opaque_in_struct_hpp ... ok
test header_opaque_template_inst_member_hpp ... ok
test header_opaque_template_inst_member_2_hpp ... ok
test header_opaque_pointer_hpp ... ok
test header_opaque_template_instantiation_hpp ... ok
test header_opaque_tracing_hpp ... FAILED
test header_opaque_template_instantiation_namespaced_hpp ... ok
test header_prepend_enum_constified_variant_h ... ok
test header_overloading_hpp ... FAILED
test header_overflowed_enum_hpp ... ok
test header_opaque_typedef_hpp ... ok
test header_partial_specialization_and_inheritance_hpp ... FAILED
test header_prepend_enum_name_hpp ... ok
test header_private_hpp ... ok
test header_redeclaration_hpp ... FAILED
test header_public_dtor_hpp ... FAILED
test header_ref_argument_array_hpp ... FAILED
test header_reparented_replacement_hpp ... ok
test header_replace_template_alias_hpp ... ok
test header_replace_use_hpp ... ok
test header_resolved_type_def_function_h ... FAILED
test header_short_enums_hpp ... ok
test header_struct_containing_forward_declared_struct_h ... ok
test header_size_t_template_hpp ... ok
test header_same_struct_name_in_different_namespaces_hpp ... ok
test header_replaces_double_hpp ... ok
test header_struct_typedef_h ... ok
test header_sentry_defined_multiple_times_hpp ... ok
test header_struct_with_anon_struct_h ... ok
test header_struct_with_anon_struct_pointer_h ... ok
test header_struct_typedef_ns_hpp ... ok
test header_struct_with_anon_struct_array_h ... ok
test header_struct_with_anon_union_h ... ok
test header_struct_with_anon_union_1_0_h ... ok
test header_struct_with_anon_unnamed_struct_h ... ok
test header_struct_with_anon_unnamed_union_1_0_h ... ok
test header_struct_with_anon_unnamed_union_h ... ok
test header_struct_with_bitfields_h ... ok
test header_struct_with_large_array_hpp ... ok
test header_struct_with_derive_debug_h ... ok
test header_struct_with_nesting_1_0_h ... ok
test header_struct_with_packing_h ... ok
test header_struct_with_struct_h ... ok
test header_struct_with_nesting_h ... ok
test header_struct_with_typedef_template_arg_hpp ... ok
test header_template_alias_namespace_hpp ... ok
test header_template_alias_basic_hpp ... ok
test header_template_alias_hpp ... ok
test header_template_param_usage_0_hpp ... ok
test header_template_param_usage_10_hpp ... ok
test header_template_fun_ty_hpp ... ok
test header_template_param_usage_11_hpp ... ok
test header_template_param_usage_14_hpp ... ok
test header_template_param_usage_12_hpp ... ok
test header_template_param_usage_13_hpp ... ok
test header_template_hpp ... FAILED
test header_template_param_usage_15_hpp ... ok
test header_template_param_usage_1_hpp ... ok
test header_template_param_usage_2_hpp ... ok
test header_template_param_usage_6_hpp ... ok
test header_template_param_usage_4_hpp ... ok
test header_template_param_usage_3_hpp ... ok
test header_template_param_usage_5_hpp ... ok
test header_template_param_usage_9_hpp ... ok
test header_template_param_usage_8_hpp ... ok
test header_template_param_usage_7_hpp ... ok
test header_template_partial_specification_hpp ... ok
test header_template_typedef_transitive_param_hpp ... ok
test header_template_typedefs_hpp ... ok
test header_template_with_var_hpp ... ok
test header_templateref_opaque_hpp ... ok
test header_type_alias_empty_hpp ... ok
test header_type_alias_partial_template_especialization_hpp ... ok
test header_type_referenced_by_whitelisted_function_h ... FAILED
test header_type_alias_template_specialized_hpp ... ok
test header_typedefd_array_as_function_arg_h ... FAILED
test header_typeref_hpp ... ok
test header_typeref_1_0_hpp ... ok
test header_union_bitfield_1_0_h ... FAILED
test header_underscore_hpp ... ok
test header_union_bitfield_h ... ok
test header_union_dtor_1_0_hpp ... FAILED
test header_union_dtor_hpp ... FAILED
test header_union_in_ns_1_0_hpp ... ok
test header_union_in_ns_hpp ... ok
test header_union_fields_1_0_hpp ... ok
test header_union_fields_hpp ... ok
test header_union_with_anon_struct_bitfield_1_0_h ... ok
test header_union_with_anon_struct_1_0_h ... ok
test header_union_template_hpp ... ok
test header_union_template_1_0_hpp ... ok
test header_union_with_anon_struct_bitfield_h ... ok
test header_union_with_anon_struct_h ... ok
test header_union_with_anon_union_1_0_h ... ok
test header_union_with_anon_union_h ... ok
test header_union_with_anon_unnamed_union_1_0_h ... ok
test header_union_with_anon_unnamed_struct_h ... ok
test header_union_with_anon_unnamed_struct_1_0_h ... ok
test header_union_with_anon_unnamed_union_h ... ok
test header_unknown_attr_h ... ok
test header_using_hpp ... ok
test header_union_with_big_member_h ... ok
test header_union_with_big_member_1_0_h ... ok
test header_union_with_nesting_h ... ok
test header_union_with_nesting_1_0_h ... ok
test header_use_core_h ... FAILED
test header_use_core_1_0_h ... FAILED
test header_virtual_dtor_hpp ... FAILED
test header_variadic_template_function_hpp ... ok
test header_var_tracing_hpp ... FAILED
test header_vector_hpp ... ok
test header_variadic_method_hpp ... FAILED
test header_virtual_inheritance_hpp ... ok
test header_virtual_overloaded_hpp ... FAILED
test header_vtable_recursive_sig_hpp ... FAILED
test header_whitelist_fix_hpp ... FAILED
test header_whitelist_basic_hpp ... ok
Checking for #include directives of system headers...
test header_what_is_going_on_hpp ... ok
test header_whitelist_namespaces_hpp ... ok
test header_whitelist_namespaces_basic_hpp ... ok
Found none; OK!
test no_system_header_includes ... ok
test header_whitelist_vars_h ... ok
test header_whitelisted_item_references_no_partialeq_hpp ... ok
test header_weird_bitfields_hpp ... ok
test test_header_contents ... FAILED
test test_multiple_header_calls_in_builder ... FAILED
failures:
---- header_arg_keyword_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/arg_keyword.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/arg_keyword.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
- #[link_name = "\u{1}_Z3fooPKc"]
+ #[link_name = "\u{1}__Z3fooPKc"]
pub fn foo(type_: *const ::std::os::raw::c_char);
}
thread 'header_arg_keyword_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:14:0
note: Run with `RUST_BACKTRACE=1` for a backtrace.
---- header_auto_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/libclang-4/auto.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/auto.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Foo {
pub _address: u8,
}
pub const Foo_kFoo: bool = true;
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
1usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
1usize,
concat!("Alignment of ", stringify!(Foo))
);
}
impl Clone for Foo {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Bar {
pub _address: u8,
}
extern "C" {
- #[link_name = "\u{1}_Z5Test2v"]
+ #[link_name = "\u{1}__Z5Test2v"]
pub fn Test2() -> ::std::os::raw::c_uint;
}
thread 'header_auto_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:15:0
---- header_bitfield_large_overflow_hpp stdout ----
/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/bitfield_large_overflow.hpp:2:12: warning: width of anonymous bit-field (632 bits) exceeds width of its type; value will be truncated to 32 bits [-Wbitfield-width], err: false
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/bitfield_large_overflow.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/bitfield_large_overflow.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct _bindgen_ty_1 {
pub _bindgen_opaque_blob: [u64; 10usize],
}
#[test]
fn bindgen_test_layout__bindgen_ty_1() {
assert_eq!(
::std::mem::size_of::<_bindgen_ty_1>(),
80usize,
concat!("Size of: ", stringify!(_bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<_bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(_bindgen_ty_1))
);
}
impl Clone for _bindgen_ty_1 {
fn clone(&self) -> Self {
*self
}
}
extern "C" {
- #[link_name = "\u{1}a"]
+ #[link_name = "\u{1}_a"]
pub static mut a: _bindgen_ty_1;
}
thread 'header_bitfield_large_overflow_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:24:0
---- header_bitfield_method_same_name_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/bitfield-method-same-name.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/bitfield-method-same-name.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Foo {
pub _bitfield_1: u8,
pub __bindgen_align: [u8; 0usize],
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
1usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
1usize,
concat!("Alignment of ", stringify!(Foo))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN3Foo4typeEv"]
+ #[link_name = "\u{1}__ZN3Foo4typeEv"]
pub fn Foo_type(this: *mut Foo) -> ::std::os::raw::c_char;
}
extern "C" {
- #[link_name = "\u{1}_ZN3Foo9set_type_Ec"]
+ #[link_name = "\u{1}__ZN3Foo9set_type_Ec"]
pub fn Foo_set_type_(this: *mut Foo, c: ::std::os::raw::c_char);
}
extern "C" {
- #[link_name = "\u{1}_ZN3Foo8set_typeEc"]
+ #[link_name = "\u{1}__ZN3Foo8set_typeEc"]
pub fn Foo_set_type(this: *mut Foo, c: ::std::os::raw::c_char);
}
impl Clone for Foo {
fn clone(&self) -> Self {
*self
}
}
impl Foo {
#[inline]
pub fn type__bindgen_bitfield(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
::std::ptr::copy_nonoverlapping(
&self._bitfield_1 as *const _ as *const u8,
&mut unit_field_val as *mut u8 as *mut u8,
::std::mem::size_of::<u8>(),
)
};
let mask = 7u64 as u8;
let val = (unit_field_val & mask) >> 0usize;
unsafe { ::std::mem::transmute(val as u8) }
}
#[inline]
pub fn set_type__bindgen_bitfield(&mut self, val: ::std::os::raw::c_char) {
let mask = 7u64 as u8;
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
::std::ptr::copy_nonoverlapping(
&self._bitfield_1 as *const _ as *const u8,
&mut unit_field_val as *mut u8 as *mut u8,
::std::mem::size_of::<u8>(),
)
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
::std::ptr::copy_nonoverlapping(
&unit_field_val as *const _ as *const u8,
&mut self._bitfield_1 as *mut _ as *mut u8,
::std::mem::size_of::<u8>(),
);
}
}
#[inline]
pub fn new_bitfield_1(type__bindgen_bitfield: ::std::os::raw::c_char) -> u8 {
(0 | ((type__bindgen_bitfield as u8 as u8) << 0usize) & (7u64 as u8))
}
#[inline]
pub unsafe fn type_(&mut self) -> ::std::os::raw::c_char {
Foo_type(self)
}
#[inline]
pub unsafe fn set_type_(&mut self, c: ::std::os::raw::c_char) {
Foo_set_type_(self, c)
}
#[inline]
pub unsafe fn set_type(&mut self, c: ::std::os::raw::c_char) {
Foo_set_type(self, c)
}
}
thread 'header_bitfield_method_same_name_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:21:0
---- header_blocks_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/blocks.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/blocks.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
+ #[link_name = "\u{1}_atexit_b"]
pub fn atexit_b(arg1: *mut ::std::os::raw::c_void);
}
thread 'header_blocks_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:27:0
---- header_canonical_path_without_namespacing_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/canonical_path_without_namespacing.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/canonical_path_without_namespacing.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Bar {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Bar() {
assert_eq!(
::std::mem::size_of::<Bar>(),
1usize,
concat!("Size of: ", stringify!(Bar))
);
assert_eq!(
::std::mem::align_of::<Bar>(),
1usize,
concat!("Alignment of ", stringify!(Bar))
);
}
impl Clone for Bar {
fn clone(&self) -> Self {
*self
}
}
extern "C" {
- #[link_name = "\u{1}_Z3bazPN3foo3BarE"]
+ #[link_name = "\u{1}__Z3bazPN3foo3BarE"]
pub fn baz(arg1: *mut Bar);
}
thread 'header_canonical_path_without_namespacing_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:31:0
---- header_class_static_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/class_static.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/class_static.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct MyClass {
pub _address: u8,
}
extern "C" {
- #[link_name = "\u{1}_ZN7MyClass7exampleE"]
+ #[link_name = "\u{1}__ZN7MyClass7exampleE"]
pub static mut MyClass_example: *const ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}_ZN7MyClass26example_check_no_collisionE"]
+ #[link_name = "\u{1}__ZN7MyClass26example_check_no_collisionE"]
pub static mut MyClass_example_check_no_collision: *const ::std::os::raw::c_int;
}
#[test]
fn bindgen_test_layout_MyClass() {
assert_eq!(
::std::mem::size_of::<MyClass>(),
1usize,
concat!("Size of: ", stringify!(MyClass))
);
assert_eq!(
::std::mem::align_of::<MyClass>(),
1usize,
concat!("Alignment of ", stringify!(MyClass))
);
}
impl Clone for MyClass {
fn clone(&self) -> Self {
*self
}
}
extern "C" {
- #[link_name = "\u{1}_ZL26example_check_no_collision"]
+ #[link_name = "\u{1}__ZL26example_check_no_collision"]
pub static mut example_check_no_collision: *const ::std::os::raw::c_int;
}
thread 'header_class_static_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:37:0
---- header_class_nested_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/class_nested.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/class_nested.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct A {
pub member_a: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct A_B {
pub member_b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_A_B() {
assert_eq!(
::std::mem::size_of::<A_B>(),
4usize,
concat!("Size of: ", stringify!(A_B))
);
assert_eq!(
::std::mem::align_of::<A_B>(),
4usize,
concat!("Alignment of ", stringify!(A_B))
);
assert_eq!(
unsafe { &(*(0 as *const A_B)).member_b as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(A_B),
"::",
stringify!(member_b)
)
);
}
impl Clone for A_B {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct A_D<T> {
pub foo: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for A_D<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[test]
fn bindgen_test_layout_A() {
assert_eq!(
::std::mem::size_of::<A>(),
4usize,
concat!("Size of: ", stringify!(A))
);
assert_eq!(
::std::mem::align_of::<A>(),
4usize,
concat!("Alignment of ", stringify!(A))
);
assert_eq!(
unsafe { &(*(0 as *const A)).member_a as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(A),
"::",
stringify!(member_a)
)
);
}
impl Clone for A {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct A_C {
pub baz: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_A_C() {
assert_eq!(
::std::mem::size_of::<A_C>(),
4usize,
concat!("Size of: ", stringify!(A_C))
);
assert_eq!(
::std::mem::align_of::<A_C>(),
4usize,
concat!("Alignment of ", stringify!(A_C))
);
assert_eq!(
unsafe { &(*(0 as *const A_C)).baz as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(A_C),
"::",
stringify!(baz)
)
);
}
impl Clone for A_C {
fn clone(&self) -> Self {
*self
}
}
extern "C" {
- #[link_name = "\u{1}var"]
+ #[link_name = "\u{1}_var"]
pub static mut var: A_B;
}
#[test]
fn __bindgen_test_layout_A_D_open0_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<A_D<::std::os::raw::c_int>>(),
4usize,
concat!(
"Size of template specialization: ",
stringify!(A_D<::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<A_D<::std::os::raw::c_int>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify!(A_D<::std::os::raw::c_int>)
)
);
}
extern "C" {
- #[link_name = "\u{1}baz"]
+ #[link_name = "\u{1}_baz"]
pub static mut baz: A_D<::std::os::raw::c_int>;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct D {
pub member: A_B,
}
#[test]
fn bindgen_test_layout_D() {
assert_eq!(
::std::mem::size_of::<D>(),
4usize,
concat!("Size of: ", stringify!(D))
);
assert_eq!(
::std::mem::align_of::<D>(),
4usize,
concat!("Alignment of ", stringify!(D))
);
assert_eq!(
unsafe { &(*(0 as *const D)).member as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(D),
"::",
stringify!(member)
)
);
}
impl Clone for D {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Templated<T> {
pub member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Templated_Templated_inner<T> {
pub member_ptr: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for Templated_Templated_inner<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
impl<T> Default for Templated<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
thread 'header_class_nested_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:35:0
---- header_class_1_0_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/class_1_0.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/class_1_0.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>);
impl<T> __IncompleteArrayField<T> {
#[inline]
pub fn new() -> Self {
__IncompleteArrayField(::std::marker::PhantomData)
}
#[inline]
pub unsafe fn as_ptr(&self) -> *const T {
::std::mem::transmute(self)
}
#[inline]
pub unsafe fn as_mut_ptr(&mut self) -> *mut T {
::std::mem::transmute(self)
}
#[inline]
pub unsafe fn as_slice(&self, len: usize) -> &[T] {
::std::slice::from_raw_parts(self.as_ptr(), len)
}
#[inline]
pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
}
}
impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__IncompleteArrayField")
}
}
impl<T> ::std::clone::Clone for __IncompleteArrayField<T> {
#[inline]
fn clone(&self) -> Self {
Self::new()
}
}
impl<T> ::std::marker::Copy for __IncompleteArrayField<T> {}
#[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()
}
}
impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
}
impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
true
}
}
impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
#[repr(C)]
#[derive(Copy)]
pub struct C {
pub a: ::std::os::raw::c_int,
pub big_array: [::std::os::raw::c_char; 33usize],
}
#[test]
fn bindgen_test_layout_C() {
assert_eq!(
::std::mem::size_of::<C>(),
40usize,
concat!("Size of: ", stringify!(C))
);
assert_eq!(
::std::mem::align_of::<C>(),
4usize,
concat!("Alignment of ", stringify!(C))
);
assert_eq!(
unsafe { &(*(0 as *const C)).a as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(C), "::", stringify!(a))
);
assert_eq!(
unsafe { &(*(0 as *const C)).big_array as *const _ as usize },
4usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(big_array)
)
);
}
impl Clone for C {
fn clone(&self) -> Self {
*self
}
}
impl Default for C {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
impl ::std::cmp::PartialEq for C {
fn eq(&self, other: &C) -> bool {
self.a == other.a && &self.big_array[..] == &other.big_array[..]
}
}
#[repr(C)]
pub struct C_with_zero_length_array {
pub a: ::std::os::raw::c_int,
pub big_array: [::std::os::raw::c_char; 33usize],
pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
}
#[test]
fn bindgen_test_layout_C_with_zero_length_array() {
assert_eq!(
::std::mem::size_of::<C_with_zero_length_array>(),
40usize,
concat!("Size of: ", stringify!(C_with_zero_length_array))
);
assert_eq!(
::std::mem::align_of::<C_with_zero_length_array>(),
4usize,
concat!("Alignment of ", stringify!(C_with_zero_length_array))
);
assert_eq!(
unsafe { &(*(0 as *const C_with_zero_length_array)).a as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(C_with_zero_length_array),
"::",
stringify!(a)
)
);
assert_eq!(
unsafe { &(*(0 as *const C_with_zero_length_array)).big_array as *const _ as usize },
4usize,
concat!(
"Alignment of field: ",
stringify!(C_with_zero_length_array),
"::",
stringify!(big_array)
)
);
assert_eq!(
unsafe {
&(*(0 as *const C_with_zero_length_array)).zero_length_array as *const _ as usize
},
37usize,
concat!(
"Alignment of field: ",
stringify!(C_with_zero_length_array),
"::",
stringify!(zero_length_array)
)
);
}
impl Default for C_with_zero_length_array {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
pub struct C_with_incomplete_array {
pub a: ::std::os::raw::c_int,
pub big_array: [::std::os::raw::c_char; 33usize],
pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
}
#[test]
fn bindgen_test_layout_C_with_incomplete_array() {
assert_eq!(
::std::mem::size_of::<C_with_incomplete_array>(),
40usize,
concat!("Size of: ", stringify!(C_with_incomplete_array))
);
assert_eq!(
::std::mem::align_of::<C_with_incomplete_array>(),
4usize,
concat!("Alignment of ", stringify!(C_with_incomplete_array))
);
}
impl Default for C_with_incomplete_array {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
pub struct C_with_zero_length_array_and_incomplete_array {
pub a: ::std::os::raw::c_int,
pub big_array: [::std::os::raw::c_char; 33usize],
pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
}
#[test]
fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
assert_eq!(
::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array>(),
40usize,
concat!(
"Size of: ",
stringify!(C_with_zero_length_array_and_incomplete_array)
)
);
assert_eq!(
::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array>(),
4usize,
concat!(
"Alignment of ",
stringify!(C_with_zero_length_array_and_incomplete_array)
)
);
}
impl Default for C_with_zero_length_array_and_incomplete_array {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Default, Hash, PartialEq, Eq)]
pub struct WithDtor {
pub b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_WithDtor() {
assert_eq!(
::std::mem::size_of::<WithDtor>(),
4usize,
concat!("Size of: ", stringify!(WithDtor))
);
assert_eq!(
::std::mem::align_of::<WithDtor>(),
4usize,
concat!("Alignment of ", stringify!(WithDtor))
);
assert_eq!(
unsafe { &(*(0 as *const WithDtor)).b as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(WithDtor),
"::",
stringify!(b)
)
);
}
#[repr(C)]
pub struct IncompleteArrayNonCopiable {
pub whatever: *mut ::std::os::raw::c_void,
pub incomplete_array: __IncompleteArrayField<C>,
}
#[test]
fn bindgen_test_layout_IncompleteArrayNonCopiable() {
assert_eq!(
::std::mem::size_of::<IncompleteArrayNonCopiable>(),
8usize,
concat!("Size of: ", stringify!(IncompleteArrayNonCopiable))
);
assert_eq!(
::std::mem::align_of::<IncompleteArrayNonCopiable>(),
8usize,
concat!("Alignment of ", stringify!(IncompleteArrayNonCopiable))
);
}
impl Default for IncompleteArrayNonCopiable {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct Union {
pub d: __BindgenUnionField<f32>,
pub i: __BindgenUnionField<::std::os::raw::c_int>,
pub bindgen_union_field: u32,
}
#[test]
fn bindgen_test_layout_Union() {
assert_eq!(
::std::mem::size_of::<Union>(),
4usize,
concat!("Size of: ", stringify!(Union))
);
assert_eq!(
::std::mem::align_of::<Union>(),
4usize,
concat!("Alignment of ", stringify!(Union))
);
assert_eq!(
unsafe { &(*(0 as *const Union)).d as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Union),
"::",
stringify!(d)
)
);
assert_eq!(
unsafe { &(*(0 as *const Union)).i as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Union),
"::",
stringify!(i)
)
);
}
impl Clone for Union {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct WithUnion {
pub data: Union,
}
#[test]
fn bindgen_test_layout_WithUnion() {
assert_eq!(
::std::mem::size_of::<WithUnion>(),
4usize,
concat!("Size of: ", stringify!(WithUnion))
);
assert_eq!(
::std::mem::align_of::<WithUnion>(),
4usize,
concat!("Alignment of ", stringify!(WithUnion))
);
assert_eq!(
unsafe { &(*(0 as *const WithUnion)).data as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(WithUnion),
"::",
stringify!(data)
)
);
}
impl Clone for WithUnion {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct RealAbstractionWithTonsOfMethods {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_RealAbstractionWithTonsOfMethods() {
assert_eq!(
::std::mem::size_of::<RealAbstractionWithTonsOfMethods>(),
1usize,
concat!("Size of: ", stringify!(RealAbstractionWithTonsOfMethods))
);
assert_eq!(
::std::mem::align_of::<RealAbstractionWithTonsOfMethods>(),
1usize,
concat!(
"Alignment of ",
stringify!(RealAbstractionWithTonsOfMethods)
)
);
}
extern "C" {
- #[link_name = "\u{1}_ZNK32RealAbstractionWithTonsOfMethods3barEv"]
+ #[link_name = "\u{1}__ZNK32RealAbstractionWithTonsOfMethods3barEv"]
pub fn RealAbstractionWithTonsOfMethods_bar(this: *const RealAbstractionWithTonsOfMethods);
}
extern "C" {
- #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEv"]
+ #[link_name = "\u{1}__ZN32RealAbstractionWithTonsOfMethods3barEv"]
pub fn RealAbstractionWithTonsOfMethods_bar1(this: *mut RealAbstractionWithTonsOfMethods);
}
extern "C" {
- #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEi"]
+ #[link_name = "\u{1}__ZN32RealAbstractionWithTonsOfMethods3barEi"]
pub fn RealAbstractionWithTonsOfMethods_bar2(
this: *mut RealAbstractionWithTonsOfMethods,
foo: ::std::os::raw::c_int,
);
}
extern "C" {
- #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3staEv"]
+ #[link_name = "\u{1}__ZN32RealAbstractionWithTonsOfMethods3staEv"]
pub fn RealAbstractionWithTonsOfMethods_sta();
}
impl Clone for RealAbstractionWithTonsOfMethods {
fn clone(&self) -> Self {
*self
}
}
impl RealAbstractionWithTonsOfMethods {
#[inline]
pub unsafe fn bar(&self) {
RealAbstractionWithTonsOfMethods_bar(self)
}
#[inline]
pub unsafe fn bar1(&mut self) {
RealAbstractionWithTonsOfMethods_bar1(self)
}
#[inline]
pub unsafe fn bar2(&mut self, foo: ::std::os::raw::c_int) {
RealAbstractionWithTonsOfMethods_bar2(self, foo)
}
#[inline]
pub unsafe fn sta() {
RealAbstractionWithTonsOfMethods_sta()
}
}
thread 'header_class_1_0_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:34:0
---- header_class_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/class.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/class.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>);
impl<T> __IncompleteArrayField<T> {
#[inline]
pub fn new() -> Self {
__IncompleteArrayField(::std::marker::PhantomData)
}
#[inline]
pub unsafe fn as_ptr(&self) -> *const T {
::std::mem::transmute(self)
}
#[inline]
pub unsafe fn as_mut_ptr(&mut self) -> *mut T {
::std::mem::transmute(self)
}
#[inline]
pub unsafe fn as_slice(&self, len: usize) -> &[T] {
::std::slice::from_raw_parts(self.as_ptr(), len)
}
#[inline]
pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
}
}
impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__IncompleteArrayField")
}
}
impl<T> ::std::clone::Clone for __IncompleteArrayField<T> {
#[inline]
fn clone(&self) -> Self {
Self::new()
}
}
impl<T> ::std::marker::Copy for __IncompleteArrayField<T> {}
#[repr(C)]
#[derive(Copy)]
pub struct C {
pub a: ::std::os::raw::c_int,
pub big_array: [::std::os::raw::c_char; 33usize],
}
#[test]
fn bindgen_test_layout_C() {
assert_eq!(
::std::mem::size_of::<C>(),
40usize,
concat!("Size of: ", stringify!(C))
);
assert_eq!(
::std::mem::align_of::<C>(),
4usize,
concat!("Alignment of ", stringify!(C))
);
assert_eq!(
unsafe { &(*(0 as *const C)).a as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(C), "::", stringify!(a))
);
assert_eq!(
unsafe { &(*(0 as *const C)).big_array as *const _ as usize },
4usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(big_array)
)
);
}
impl Clone for C {
fn clone(&self) -> Self {
*self
}
}
impl Default for C {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
pub struct C_with_zero_length_array {
pub a: ::std::os::raw::c_int,
pub big_array: [::std::os::raw::c_char; 33usize],
pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
}
#[test]
fn bindgen_test_layout_C_with_zero_length_array() {
assert_eq!(
::std::mem::size_of::<C_with_zero_length_array>(),
40usize,
concat!("Size of: ", stringify!(C_with_zero_length_array))
);
assert_eq!(
::std::mem::align_of::<C_with_zero_length_array>(),
4usize,
concat!("Alignment of ", stringify!(C_with_zero_length_array))
);
assert_eq!(
unsafe { &(*(0 as *const C_with_zero_length_array)).a as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(C_with_zero_length_array),
"::",
stringify!(a)
)
);
assert_eq!(
unsafe { &(*(0 as *const C_with_zero_length_array)).big_array as *const _ as usize },
4usize,
concat!(
"Alignment of field: ",
stringify!(C_with_zero_length_array),
"::",
stringify!(big_array)
)
);
assert_eq!(
unsafe {
&(*(0 as *const C_with_zero_length_array)).zero_length_array as *const _ as usize
},
37usize,
concat!(
"Alignment of field: ",
stringify!(C_with_zero_length_array),
"::",
stringify!(zero_length_array)
)
);
}
impl Default for C_with_zero_length_array {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
pub struct C_with_incomplete_array {
pub a: ::std::os::raw::c_int,
pub big_array: [::std::os::raw::c_char; 33usize],
pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
}
#[test]
fn bindgen_test_layout_C_with_incomplete_array() {
assert_eq!(
::std::mem::size_of::<C_with_incomplete_array>(),
40usize,
concat!("Size of: ", stringify!(C_with_incomplete_array))
);
assert_eq!(
::std::mem::align_of::<C_with_incomplete_array>(),
4usize,
concat!("Alignment of ", stringify!(C_with_incomplete_array))
);
}
impl Default for C_with_incomplete_array {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
pub struct C_with_zero_length_array_and_incomplete_array {
pub a: ::std::os::raw::c_int,
pub big_array: [::std::os::raw::c_char; 33usize],
pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
}
#[test]
fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
assert_eq!(
::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array>(),
40usize,
concat!(
"Size of: ",
stringify!(C_with_zero_length_array_and_incomplete_array)
)
);
assert_eq!(
::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array>(),
4usize,
concat!(
"Alignment of ",
stringify!(C_with_zero_length_array_and_incomplete_array)
)
);
}
impl Default for C_with_zero_length_array_and_incomplete_array {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Default, Hash, PartialEq, Eq)]
pub struct WithDtor {
pub b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_WithDtor() {
assert_eq!(
::std::mem::size_of::<WithDtor>(),
4usize,
concat!("Size of: ", stringify!(WithDtor))
);
assert_eq!(
::std::mem::align_of::<WithDtor>(),
4usize,
concat!("Alignment of ", stringify!(WithDtor))
);
assert_eq!(
unsafe { &(*(0 as *const WithDtor)).b as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(WithDtor),
"::",
stringify!(b)
)
);
}
#[repr(C)]
pub struct IncompleteArrayNonCopiable {
pub whatever: *mut ::std::os::raw::c_void,
pub incomplete_array: __IncompleteArrayField<C>,
}
#[test]
fn bindgen_test_layout_IncompleteArrayNonCopiable() {
assert_eq!(
::std::mem::size_of::<IncompleteArrayNonCopiable>(),
8usize,
concat!("Size of: ", stringify!(IncompleteArrayNonCopiable))
);
assert_eq!(
::std::mem::align_of::<IncompleteArrayNonCopiable>(),
8usize,
concat!("Alignment of ", stringify!(IncompleteArrayNonCopiable))
);
}
impl Default for IncompleteArrayNonCopiable {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Copy)]
pub union Union {
pub d: f32,
pub i: ::std::os::raw::c_int,
_bindgen_union_align: u32,
}
#[test]
fn bindgen_test_layout_Union() {
assert_eq!(
::std::mem::size_of::<Union>(),
4usize,
concat!("Size of: ", stringify!(Union))
);
assert_eq!(
::std::mem::align_of::<Union>(),
4usize,
concat!("Alignment of ", stringify!(Union))
);
assert_eq!(
unsafe { &(*(0 as *const Union)).d as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Union),
"::",
stringify!(d)
)
);
assert_eq!(
unsafe { &(*(0 as *const Union)).i as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Union),
"::",
stringify!(i)
)
);
}
impl Clone for Union {
fn clone(&self) -> Self {
*self
}
}
impl Default for Union {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Copy)]
pub struct WithUnion {
pub data: Union,
}
#[test]
fn bindgen_test_layout_WithUnion() {
assert_eq!(
::std::mem::size_of::<WithUnion>(),
4usize,
concat!("Size of: ", stringify!(WithUnion))
);
assert_eq!(
::std::mem::align_of::<WithUnion>(),
4usize,
concat!("Alignment of ", stringify!(WithUnion))
);
assert_eq!(
unsafe { &(*(0 as *const WithUnion)).data as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(WithUnion),
"::",
stringify!(data)
)
);
}
impl Clone for WithUnion {
fn clone(&self) -> Self {
*self
}
}
impl Default for WithUnion {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct RealAbstractionWithTonsOfMethods {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_RealAbstractionWithTonsOfMethods() {
assert_eq!(
::std::mem::size_of::<RealAbstractionWithTonsOfMethods>(),
1usize,
concat!("Size of: ", stringify!(RealAbstractionWithTonsOfMethods))
);
assert_eq!(
::std::mem::align_of::<RealAbstractionWithTonsOfMethods>(),
1usize,
concat!(
"Alignment of ",
stringify!(RealAbstractionWithTonsOfMethods)
)
);
}
extern "C" {
- #[link_name = "\u{1}_ZNK32RealAbstractionWithTonsOfMethods3barEv"]
+ #[link_name = "\u{1}__ZNK32RealAbstractionWithTonsOfMethods3barEv"]
pub fn RealAbstractionWithTonsOfMethods_bar(this: *const RealAbstractionWithTonsOfMethods);
}
extern "C" {
- #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEv"]
+ #[link_name = "\u{1}__ZN32RealAbstractionWithTonsOfMethods3barEv"]
pub fn RealAbstractionWithTonsOfMethods_bar1(this: *mut RealAbstractionWithTonsOfMethods);
}
extern "C" {
- #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEi"]
+ #[link_name = "\u{1}__ZN32RealAbstractionWithTonsOfMethods3barEi"]
pub fn RealAbstractionWithTonsOfMethods_bar2(
this: *mut RealAbstractionWithTonsOfMethods,
foo: ::std::os::raw::c_int,
);
}
extern "C" {
- #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3staEv"]
+ #[link_name = "\u{1}__ZN32RealAbstractionWithTonsOfMethods3staEv"]
pub fn RealAbstractionWithTonsOfMethods_sta();
}
impl Clone for RealAbstractionWithTonsOfMethods {
fn clone(&self) -> Self {
*self
}
}
impl RealAbstractionWithTonsOfMethods {
#[inline]
pub unsafe fn bar(&self) {
RealAbstractionWithTonsOfMethods_bar(self)
}
#[inline]
pub unsafe fn bar1(&mut self) {
RealAbstractionWithTonsOfMethods_bar1(self)
}
#[inline]
pub unsafe fn bar2(&mut self, foo: ::std::os::raw::c_int) {
RealAbstractionWithTonsOfMethods_bar2(self, foo)
}
#[inline]
pub unsafe fn sta() {
RealAbstractionWithTonsOfMethods_sta()
}
}
thread 'header_class_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:33:0
---- header_complex_global_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/complex_global.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/complex_global.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)]
#[repr(C)]
pub struct __BindgenComplex<T> {
pub re: T,
pub im: T,
}
extern "C" {
- #[link_name = "\u{1}globalValueFloat"]
+ #[link_name = "\u{1}_globalValueFloat"]
pub static mut globalValueFloat: __BindgenComplex<f32>;
}
extern "C" {
- #[link_name = "\u{1}globalValueDouble"]
+ #[link_name = "\u{1}_globalValueDouble"]
pub static mut globalValueDouble: __BindgenComplex<f64>;
}
extern "C" {
- #[link_name = "\u{1}globalValueLongDouble"]
+ #[link_name = "\u{1}_globalValueLongDouble"]
pub static mut globalValueLongDouble: __BindgenComplex<f64>;
}
thread 'header_complex_global_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:46:0
---- header_const_array_fn_arg_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/const_array_fn_arg.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/const_array_fn_arg.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
+ #[link_name = "\u{1}_f"]
pub fn f(a: *const ::std::os::raw::c_int);
}
thread 'header_const_array_fn_arg_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:47:0
---- header_class_with_typedef_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/class_with_typedef.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/class_with_typedef.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type AnotherInt = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
pub struct C {
pub c: C_MyInt,
pub ptr: *mut C_MyInt,
pub arr: [C_MyInt; 10usize],
pub d: AnotherInt,
pub other_ptr: *mut AnotherInt,
}
pub type C_MyInt = ::std::os::raw::c_int;
pub type C_Lookup = *const ::std::os::raw::c_char;
#[test]
fn bindgen_test_layout_C() {
assert_eq!(
::std::mem::size_of::<C>(),
72usize,
concat!("Size of: ", stringify!(C))
);
assert_eq!(
::std::mem::align_of::<C>(),
8usize,
concat!("Alignment of ", stringify!(C))
);
assert_eq!(
unsafe { &(*(0 as *const C)).c as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(C), "::", stringify!(c))
);
assert_eq!(
unsafe { &(*(0 as *const C)).ptr as *const _ as usize },
8usize,
concat!("Alignment of field: ", stringify!(C), "::", stringify!(ptr))
);
assert_eq!(
unsafe { &(*(0 as *const C)).arr as *const _ as usize },
16usize,
concat!("Alignment of field: ", stringify!(C), "::", stringify!(arr))
);
assert_eq!(
unsafe { &(*(0 as *const C)).d as *const _ as usize },
56usize,
concat!("Alignment of field: ", stringify!(C), "::", stringify!(d))
);
assert_eq!(
unsafe { &(*(0 as *const C)).other_ptr as *const _ as usize },
64usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(other_ptr)
)
);
}
extern "C" {
- #[link_name = "\u{1}_ZN1C6methodEi"]
+ #[link_name = "\u{1}__ZN1C6methodEi"]
pub fn C_method(this: *mut C, c: C_MyInt);
}
extern "C" {
- #[link_name = "\u{1}_ZN1C9methodRefERi"]
+ #[link_name = "\u{1}__ZN1C9methodRefERi"]
pub fn C_methodRef(this: *mut C, c: *mut C_MyInt);
}
extern "C" {
- #[link_name = "\u{1}_ZN1C16complexMethodRefERPKc"]
+ #[link_name = "\u{1}__ZN1C16complexMethodRefERPKc"]
pub fn C_complexMethodRef(this: *mut C, c: *mut C_Lookup);
}
extern "C" {
- #[link_name = "\u{1}_ZN1C13anotherMethodEi"]
+ #[link_name = "\u{1}__ZN1C13anotherMethodEi"]
pub fn C_anotherMethod(this: *mut C, c: AnotherInt);
}
impl Clone for C {
fn clone(&self) -> Self {
*self
}
}
impl Default for C {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
impl C {
#[inline]
pub unsafe fn method(&mut self, c: C_MyInt) {
C_method(self, c)
}
#[inline]
pub unsafe fn methodRef(&mut self, c: *mut C_MyInt) {
C_methodRef(self, c)
}
#[inline]
pub unsafe fn complexMethodRef(&mut self, c: *mut C_Lookup) {
C_complexMethodRef(self, c)
}
#[inline]
pub unsafe fn anotherMethod(&mut self, c: AnotherInt) {
C_anotherMethod(self, c)
}
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
pub struct D {
pub _base: C,
pub ptr: *mut C_MyInt,
}
#[test]
fn bindgen_test_layout_D() {
assert_eq!(
::std::mem::size_of::<D>(),
80usize,
concat!("Size of: ", stringify!(D))
);
assert_eq!(
::std::mem::align_of::<D>(),
8usize,
concat!("Alignment of ", stringify!(D))
);
assert_eq!(
unsafe { &(*(0 as *const D)).ptr as *const _ as usize },
72usize,
concat!("Alignment of field: ", stringify!(D), "::", stringify!(ptr))
);
}
impl Clone for D {
fn clone(&self) -> Self {
*self
}
}
impl Default for D {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
thread 'header_class_with_typedef_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:43:0
---- header_const_resolved_ty_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/const_resolved_ty.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/const_resolved_ty.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
+ #[link_name = "\u{1}_foo"]
pub fn foo(foo: *const u8);
}
thread 'header_const_resolved_ty_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:51:0
---- header_const_ptr_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/const_ptr.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/const_ptr.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
+ #[link_name = "\u{1}_foo"]
pub fn foo(bar: *const ::std::os::raw::c_void);
}
thread 'header_const_ptr_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:50:0
---- header_constructor_tp_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/constructor-tp.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/constructor-tp.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Foo {
pub _address: u8,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Bar {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Bar() {
assert_eq!(
::std::mem::size_of::<Bar>(),
1usize,
concat!("Size of: ", stringify!(Bar))
);
assert_eq!(
::std::mem::align_of::<Bar>(),
1usize,
concat!("Alignment of ", stringify!(Bar))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN3BarC1Ev"]
+ #[link_name = "\u{1}__ZN3BarC1Ev"]
pub fn Bar_Bar(this: *mut Bar);
}
impl Clone for Bar {
fn clone(&self) -> Self {
*self
}
}
impl Bar {
#[inline]
pub unsafe fn new() -> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
Bar_Bar(&mut __bindgen_tmp);
__bindgen_tmp
}
}
thread 'header_constructor_tp_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:63:0
---- header_constify_module_enums_basic_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/constify-module-enums-basic.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/constify-module-enums-basic.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod foo {
pub type Type = ::std::os::raw::c_uint;
pub const THIS: Type = 0;
pub const SHOULD_BE: Type = 1;
pub const A_CONSTANT: Type = 2;
}
pub use self::foo::Type as foo_alias1;
pub use self::foo_alias1 as foo_alias2;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct bar {
pub this_should_work: foo::Type,
}
#[test]
fn bindgen_test_layout_bar() {
assert_eq!(
::std::mem::size_of::<bar>(),
4usize,
concat!("Size of: ", stringify!(bar))
);
assert_eq!(
::std::mem::align_of::<bar>(),
4usize,
concat!("Alignment of ", stringify!(bar))
);
assert_eq!(
unsafe { &(*(0 as *const bar)).this_should_work as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(this_should_work)
)
);
}
impl Clone for bar {
fn clone(&self) -> Self {
*self
}
}
impl Default for bar {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
+ #[link_name = "\u{1}_func1"]
pub fn func1(
arg1: foo::Type,
arg2: *mut foo::Type,
arg3: *mut *mut foo::Type,
) -> *mut foo::Type;
}
extern "C" {
+ #[link_name = "\u{1}_func2"]
pub fn func2(
arg1: foo_alias1,
arg2: *mut foo_alias1,
arg3: *mut *mut foo_alias1,
) -> *mut foo_alias1;
}
thread 'header_constify_module_enums_basic_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:57:0
---- header_constructors_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/constructors.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/constructors.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct TestOverload {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_TestOverload() {
assert_eq!(
::std::mem::size_of::<TestOverload>(),
1usize,
concat!("Size of: ", stringify!(TestOverload))
);
assert_eq!(
::std::mem::align_of::<TestOverload>(),
1usize,
concat!("Alignment of ", stringify!(TestOverload))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN12TestOverloadC1Ei"]
+ #[link_name = "\u{1}__ZN12TestOverloadC1Ei"]
pub fn TestOverload_TestOverload(this: *mut TestOverload, arg1: ::std::os::raw::c_int);
}
extern "C" {
- #[link_name = "\u{1}_ZN12TestOverloadC1Ed"]
+ #[link_name = "\u{1}__ZN12TestOverloadC1Ed"]
pub fn TestOverload_TestOverload1(this: *mut TestOverload, arg1: f64);
}
impl Clone for TestOverload {
fn clone(&self) -> Self {
*self
}
}
impl TestOverload {
#[inline]
pub unsafe fn new(arg1: ::std::os::raw::c_int) -> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
TestOverload_TestOverload(&mut __bindgen_tmp, arg1);
__bindgen_tmp
}
#[inline]
pub unsafe fn new1(arg1: f64) -> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
TestOverload_TestOverload1(&mut __bindgen_tmp, arg1);
__bindgen_tmp
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct TestPublicNoArgs {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_TestPublicNoArgs() {
assert_eq!(
::std::mem::size_of::<TestPublicNoArgs>(),
1usize,
concat!("Size of: ", stringify!(TestPublicNoArgs))
);
assert_eq!(
::std::mem::align_of::<TestPublicNoArgs>(),
1usize,
concat!("Alignment of ", stringify!(TestPublicNoArgs))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN16TestPublicNoArgsC1Ev"]
+ #[link_name = "\u{1}__ZN16TestPublicNoArgsC1Ev"]
pub fn TestPublicNoArgs_TestPublicNoArgs(this: *mut TestPublicNoArgs);
}
impl Clone for TestPublicNoArgs {
fn clone(&self) -> Self {
*self
}
}
impl TestPublicNoArgs {
#[inline]
pub unsafe fn new() -> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
TestPublicNoArgs_TestPublicNoArgs(&mut __bindgen_tmp);
__bindgen_tmp
}
}
thread 'header_constructors_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:64:0
---- header_constify_module_enums_types_hpp stdout ----
/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/constify-module-enums-types.hpp:27:8: warning: scoped enumerations are a C++11 extension [-Wc++11-extensions], err: false
/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/constify-module-enums-types.hpp:59:8: warning: scoped enumerations are a C++11 extension [-Wc++11-extensions], err: false
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/constify-module-enums-types.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/constify-module-enums-types.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod foo {
pub type Type = ::std::os::raw::c_uint;
pub const THIS: Type = 0;
pub const SHOULD_BE: Type = 1;
pub const A_CONSTANT: Type = 2;
pub const ALSO_THIS: Type = 42;
pub const AND_ALSO_THIS: Type = 42;
}
pub mod anon_enum {
pub type Type = ::std::os::raw::c_uint;
pub const Variant1: Type = 0;
pub const Variant2: Type = 1;
pub const Variant3: Type = 2;
}
pub mod ns1_foo {
pub type Type = ::std::os::raw::c_uint;
pub const THIS: Type = 0;
pub const SHOULD_BE: Type = 1;
pub const A_CONSTANT: Type = 2;
pub const ALSO_THIS: Type = 42;
}
pub mod ns2_Foo {
pub type Type = ::std::os::raw::c_int;
pub const Variant1: Type = 0;
pub const Variant2: Type = 1;
}
pub use self::foo::Type as foo_alias1;
pub use self::foo_alias1 as foo_alias2;
pub use self::foo_alias2 as foo_alias3;
pub use self::anon_enum::Type as anon_enum_alias1;
pub use self::anon_enum_alias1 as anon_enum_alias2;
pub use self::anon_enum_alias2 as anon_enum_alias3;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct bar {
pub member1: foo::Type,
pub member2: foo_alias1,
pub member3: foo_alias2,
pub member4: foo_alias3,
pub member5: ns1_foo::Type,
pub member6: *mut ns2_Foo::Type,
pub member7: anon_enum::Type,
pub member8: anon_enum_alias1,
pub member9: anon_enum_alias2,
pub member10: anon_enum_alias3,
}
#[test]
fn bindgen_test_layout_bar() {
assert_eq!(
::std::mem::size_of::<bar>(),
48usize,
concat!("Size of: ", stringify!(bar))
);
assert_eq!(
::std::mem::align_of::<bar>(),
8usize,
concat!("Alignment of ", stringify!(bar))
);
assert_eq!(
unsafe { &(*(0 as *const bar)).member1 as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(member1)
)
);
assert_eq!(
unsafe { &(*(0 as *const bar)).member2 as *const _ as usize },
4usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(member2)
)
);
assert_eq!(
unsafe { &(*(0 as *const bar)).member3 as *const _ as usize },
8usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(member3)
)
);
assert_eq!(
unsafe { &(*(0 as *const bar)).member4 as *const _ as usize },
12usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(member4)
)
);
assert_eq!(
unsafe { &(*(0 as *const bar)).member5 as *const _ as usize },
16usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(member5)
)
);
assert_eq!(
unsafe { &(*(0 as *const bar)).member6 as *const _ as usize },
24usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(member6)
)
);
assert_eq!(
unsafe { &(*(0 as *const bar)).member7 as *const _ as usize },
32usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(member7)
)
);
assert_eq!(
unsafe { &(*(0 as *const bar)).member8 as *const _ as usize },
36usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(member8)
)
);
assert_eq!(
unsafe { &(*(0 as *const bar)).member9 as *const _ as usize },
40usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(member9)
)
);
assert_eq!(
unsafe { &(*(0 as *const bar)).member10 as *const _ as usize },
44usize,
concat!(
"Alignment of field: ",
stringify!(bar),
"::",
stringify!(member10)
)
);
}
impl Clone for bar {
fn clone(&self) -> Self {
*self
}
}
impl Default for bar {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Baz {
pub member1: ns2_Foo::Type,
}
#[test]
fn bindgen_test_layout_Baz() {
assert_eq!(
::std::mem::size_of::<Baz>(),
4usize,
concat!("Size of: ", stringify!(Baz))
);
assert_eq!(
::std::mem::align_of::<Baz>(),
4usize,
concat!("Alignment of ", stringify!(Baz))
);
assert_eq!(
unsafe { &(*(0 as *const Baz)).member1 as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Baz),
"::",
stringify!(member1)
)
);
}
impl Clone for Baz {
fn clone(&self) -> Self {
*self
}
}
impl Default for Baz {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
pub mod one_Foo {
pub type Type = ::std::os::raw::c_int;
pub const Variant1: Type = 0;
pub const Variant2: Type = 1;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Bar {
pub baz: *mut one_Foo::Type,
}
#[test]
fn bindgen_test_layout_Bar() {
assert_eq!(
::std::mem::size_of::<Bar>(),
8usize,
concat!("Size of: ", stringify!(Bar))
);
assert_eq!(
::std::mem::align_of::<Bar>(),
8usize,
concat!("Alignment of ", stringify!(Bar))
);
assert_eq!(
unsafe { &(*(0 as *const Bar)).baz as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Bar),
"::",
stringify!(baz)
)
);
}
impl Clone for Bar {
fn clone(&self) -> Self {
*self
}
}
impl Default for Bar {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_Z5func13fooPS_PS0_"]
+ #[link_name = "\u{1}__Z5func13fooPS_PS0_"]
pub fn func1(
arg1: foo::Type,
arg2: *mut foo::Type,
arg3: *mut *mut foo::Type,
) -> *mut foo::Type;
}
extern "C" {
- #[link_name = "\u{1}_Z5func23fooPS_PS0_"]
+ #[link_name = "\u{1}__Z5func23fooPS_PS0_"]
pub fn func2(
arg1: foo_alias1,
arg2: *mut foo_alias1,
arg3: *mut *mut foo_alias1,
) -> *mut foo_alias1;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Thing<T> {
pub thing: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for Thing<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_Z5func35ThingI3fooE"]
+ #[link_name = "\u{1}__Z5func35ThingI3fooE"]
pub fn func3(arg1: Thing<foo::Type>) -> foo::Type;
}
extern "C" {
- #[link_name = "\u{1}_Z5func45ThingIS_I3fooEE"]
+ #[link_name = "\u{1}__Z5func45ThingIS_I3fooEE"]
pub fn func4(arg1: Thing<Thing<foo::Type>>) -> foo::Type;
}
thread 'header_constify_module_enums_types_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:62:0
---- header_decl_ptr_to_array_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/decl_ptr_to_array.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/decl_ptr_to_array.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
- #[link_name = "\u{1}foo"]
+ #[link_name = "\u{1}_foo"]
pub static mut foo: *mut [::std::os::raw::c_int; 1usize];
}
thread 'header_decl_ptr_to_array_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:71:0
---- header_decl_extern_int_twice_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/decl_extern_int_twice.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/decl_extern_int_twice.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
- #[link_name = "\u{1}foo"]
+ #[link_name = "\u{1}_foo"]
pub static mut foo: ::std::os::raw::c_int;
}
thread 'header_decl_extern_int_twice_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:70:0
---- header_default_template_parameter_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/default-template-parameter.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/default-template-parameter.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Foo<T, U> {
pub t: T,
pub u: U,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>,
}
impl<T, U> Default for Foo<T, U> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[test]
fn __bindgen_test_layout_Foo_open0_bool__int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<Foo<bool, ::std::os::raw::c_int>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify ! ( Foo < bool , :: std :: os :: raw :: c_int > )
)
);
assert_eq!(
::std::mem::align_of::<Foo<bool, ::std::os::raw::c_int>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify ! ( Foo < bool , :: std :: os :: raw :: c_int > )
)
);
}
extern "C" {
- #[link_name = "\u{1}_ZL3bar"]
+ #[link_name = "\u{1}__ZL3bar"]
pub static mut bar: Foo<bool, ::std::os::raw::c_int>;
}
thread 'header_default_template_parameter_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:72:0
---- header_derive_bitfield_method_same_name_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/derive-bitfield-method-same-name.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/derive-bitfield-method-same-name.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/// Because this struct have array larger than 32 items
/// and --with-derive-partialeq --impl-partialeq --impl-debug is provided,
/// this struct should manually implement `Debug` and `PartialEq`.
#[repr(C)]
#[derive(Copy)]
pub struct Foo {
pub large: [::std::os::raw::c_int; 33usize],
pub _bitfield_1: [u8; 2usize],
pub __bindgen_padding_0: u16,
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
136usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
4usize,
concat!("Alignment of ", stringify!(Foo))
);
assert_eq!(
unsafe { &(*(0 as *const Foo)).large as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Foo),
"::",
stringify!(large)
)
);
}
extern "C" {
- #[link_name = "\u{1}_ZN3Foo4typeEv"]
+ #[link_name = "\u{1}__ZN3Foo4typeEv"]
pub fn Foo_type(this: *mut Foo) -> ::std::os::raw::c_char;
}
extern "C" {
- #[link_name = "\u{1}_ZN3Foo9set_type_Ec"]
+ #[link_name = "\u{1}__ZN3Foo9set_type_Ec"]
pub fn Foo_set_type_(this: *mut Foo, c: ::std::os::raw::c_char);
}
extern "C" {
- #[link_name = "\u{1}_ZN3Foo8set_typeEc"]
+ #[link_name = "\u{1}__ZN3Foo8set_typeEc"]
pub fn Foo_set_type(this: *mut Foo, c: ::std::os::raw::c_char);
}
impl Clone for Foo {
fn clone(&self) -> Self {
*self
}
}
impl Default for Foo {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
impl ::std::fmt::Debug for Foo {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(
f,
"Foo {{ large: [{}], type_ : {:?}, }}",
self.large
.iter()
.enumerate()
.map(|(i, v)| format!("{}{:?}", if i > 0 { ", " } else { "" }, v))
.collect::<String>(),
self.type__bindgen_bitfield()
)
}
}
impl ::std::cmp::PartialEq for Foo {
fn eq(&self, other: &Foo) -> bool {
&self.large[..] == &other.large[..]
&& self.type__bindgen_bitfield() == other.type__bindgen_bitfield()
}
}
impl Foo {
#[inline]
pub fn type__bindgen_bitfield(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
::std::ptr::copy_nonoverlapping(
&self._bitfield_1 as *const _ as *const u8,
&mut unit_field_val as *mut u16 as *mut u8,
::std::mem::size_of::<u16>(),
)
};
let mask = 7u64 as u16;
let val = (unit_field_val & mask) >> 0usize;
unsafe { ::std::mem::transmute(val as u8) }
}
#[inline]
pub fn set_type__bindgen_bitfield(&mut self, val: ::std::os::raw::c_char) {
let mask = 7u64 as u16;
let val = val as u8 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
::std::ptr::copy_nonoverlapping(
&self._bitfield_1 as *const _ as *const u8,
&mut unit_field_val as *mut u16 as *mut u8,
::std::mem::size_of::<u16>(),
)
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
::std::ptr::copy_nonoverlapping(
&unit_field_val as *const _ as *const u8,
&mut self._bitfield_1 as *mut _ as *mut u8,
::std::mem::size_of::<u16>(),
);
}
}
#[inline]
pub fn new_bitfield_1(type__bindgen_bitfield: ::std::os::raw::c_char) -> u16 {
(0 | ((type__bindgen_bitfield as u8 as u16) << 0usize) & (7u64 as u16))
}
#[inline]
pub unsafe fn type_(&mut self) -> ::std::os::raw::c_char {
Foo_type(self)
}
#[inline]
pub unsafe fn set_type_(&mut self, c: ::std::os::raw::c_char) {
Foo_set_type_(self, c)
}
#[inline]
pub unsafe fn set_type(&mut self, c: ::std::os::raw::c_char) {
Foo_set_type(self, c)
}
}
thread 'header_derive_bitfield_method_same_name_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:73:0
---- header_elaborated_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/elaborated.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/elaborated.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type whatever_whatever_t = ::std::os::raw::c_int;
extern "C" {
- #[link_name = "\u{1}_Z9somethingPKi"]
+ #[link_name = "\u{1}__Z9somethingPKi"]
pub fn something(wat: *const whatever_whatever_t);
}
thread 'header_elaborated_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:102:0
---- header_enum_and_vtable_mangling_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/enum_and_vtable_mangling.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/enum_and_vtable_mangling.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const match_: _bindgen_ty_1 = _bindgen_ty_1::match_;
pub const whatever_else: _bindgen_ty_1 = _bindgen_ty_1::whatever_else;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum _bindgen_ty_1 {
match_ = 0,
whatever_else = 1,
}
#[repr(C)]
pub struct C__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct C {
pub vtable_: *const C__bindgen_vtable,
pub i: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_C() {
assert_eq!(
::std::mem::size_of::<C>(),
16usize,
concat!("Size of: ", stringify!(C))
);
assert_eq!(
::std::mem::align_of::<C>(),
8usize,
concat!("Alignment of ", stringify!(C))
);
assert_eq!(
unsafe { &(*(0 as *const C)).i as *const _ as usize },
8usize,
concat!("Alignment of field: ", stringify!(C), "::", stringify!(i))
);
}
impl Clone for C {
fn clone(&self) -> Self {
*self
}
}
impl Default for C {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_ZN1C5matchEv"]
+ #[link_name = "\u{1}__ZN1C5matchEv"]
pub fn C_match(this: *mut ::std::os::raw::c_void);
}
thread 'header_enum_and_vtable_mangling_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:106:0
---- header_forward_declared_complex_types_1_0_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/forward_declared_complex_types_1_0.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/forward_declared_complex_types_1_0.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Foo_empty {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Foo_empty() {
assert_eq!(
::std::mem::size_of::<Foo_empty>(),
1usize,
concat!("Size of: ", stringify!(Foo_empty))
);
assert_eq!(
::std::mem::align_of::<Foo_empty>(),
1usize,
concat!("Alignment of ", stringify!(Foo_empty))
);
}
impl Clone for Foo_empty {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Foo {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Bar {
pub f: *mut Foo,
}
#[test]
fn bindgen_test_layout_Bar() {
assert_eq!(
::std::mem::size_of::<Bar>(),
8usize,
concat!("Size of: ", stringify!(Bar))
);
assert_eq!(
::std::mem::align_of::<Bar>(),
8usize,
concat!("Alignment of ", stringify!(Bar))
);
assert_eq!(
unsafe { &(*(0 as *const Bar)).f as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(Bar), "::", stringify!(f))
);
}
impl Clone for Bar {
fn clone(&self) -> Self {
*self
}
}
impl Default for Bar {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_Z10baz_structP3Foo"]
+ #[link_name = "\u{1}__Z10baz_structP3Foo"]
pub fn baz_struct(f: *mut Foo);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Union {
_unused: [u8; 0],
}
extern "C" {
- #[link_name = "\u{1}_Z9baz_unionP5Union"]
+ #[link_name = "\u{1}__Z9baz_unionP5Union"]
pub fn baz_union(u: *mut Union);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Quux {
_unused: [u8; 0],
}
extern "C" {
- #[link_name = "\u{1}_Z9baz_classP4Quux"]
+ #[link_name = "\u{1}__Z9baz_classP4Quux"]
pub fn baz_class(q: *mut Quux);
}
thread 'header_forward_declared_complex_types_1_0_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:120:0
---- header_forward_declared_complex_types_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/forward_declared_complex_types.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/forward_declared_complex_types.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Foo_empty {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Foo_empty() {
assert_eq!(
::std::mem::size_of::<Foo_empty>(),
1usize,
concat!("Size of: ", stringify!(Foo_empty))
);
assert_eq!(
::std::mem::align_of::<Foo_empty>(),
1usize,
concat!("Alignment of ", stringify!(Foo_empty))
);
}
impl Clone for Foo_empty {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Foo {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Bar {
pub f: *mut Foo,
}
#[test]
fn bindgen_test_layout_Bar() {
assert_eq!(
::std::mem::size_of::<Bar>(),
8usize,
concat!("Size of: ", stringify!(Bar))
);
assert_eq!(
::std::mem::align_of::<Bar>(),
8usize,
concat!("Alignment of ", stringify!(Bar))
);
assert_eq!(
unsafe { &(*(0 as *const Bar)).f as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(Bar), "::", stringify!(f))
);
}
impl Clone for Bar {
fn clone(&self) -> Self {
*self
}
}
impl Default for Bar {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_Z10baz_structP3Foo"]
+ #[link_name = "\u{1}__Z10baz_structP3Foo"]
pub fn baz_struct(f: *mut Foo);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Union {
_unused: [u8; 0],
}
extern "C" {
- #[link_name = "\u{1}_Z9baz_unionP5Union"]
+ #[link_name = "\u{1}__Z9baz_unionP5Union"]
pub fn baz_union(u: *mut Union);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Quux {
_unused: [u8; 0],
}
extern "C" {
- #[link_name = "\u{1}_Z9baz_classP4Quux"]
+ #[link_name = "\u{1}__Z9baz_classP4Quux"]
pub fn baz_class(q: *mut Quux);
}
thread 'header_forward_declared_complex_types_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:119:0
---- header_func_ptr_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/func_ptr.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/func_ptr.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
- #[link_name = "\u{1}foo"]
+ #[link_name = "\u{1}_foo"]
pub static mut foo:
::std::option::Option<
unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int)
-> ::std::os::raw::c_int,
>;
}
thread 'header_func_ptr_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:123:0
---- header_func_with_func_ptr_arg_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/func_with_func_ptr_arg.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/func_with_func_ptr_arg.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
+ #[link_name = "\u{1}_foo"]
pub fn foo(bar: ::std::option::Option<unsafe extern "C" fn()>);
}
thread 'header_func_with_func_ptr_arg_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:126:0
---- header_func_with_array_arg_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/func_with_array_arg.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/func_with_array_arg.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
+ #[link_name = "\u{1}_f"]
pub fn f(x: *mut ::std::os::raw::c_int);
}
thread 'header_func_with_array_arg_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:125:0
---- header_gen_constructors_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/gen-constructors.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/gen-constructors.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Foo {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
1usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
1usize,
concat!("Alignment of ", stringify!(Foo))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN3FooC1Ei"]
+ #[link_name = "\u{1}__ZN3FooC1Ei"]
pub fn Foo_Foo(this: *mut Foo, a: ::std::os::raw::c_int);
}
impl Clone for Foo {
fn clone(&self) -> Self {
*self
}
}
impl Foo {
#[inline]
pub unsafe fn new(a: ::std::os::raw::c_int) -> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
Foo_Foo(&mut __bindgen_tmp, a);
__bindgen_tmp
}
}
thread 'header_gen_constructors_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:128:0
---- header_gen_destructors_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/gen-destructors.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/gen-destructors.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default)]
pub struct Foo {
pub bar: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
4usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
4usize,
concat!("Alignment of ", stringify!(Foo))
);
assert_eq!(
unsafe { &(*(0 as *const Foo)).bar as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Foo),
"::",
stringify!(bar)
)
);
}
extern "C" {
- #[link_name = "\u{1}_ZN3FooD1Ev"]
+ #[link_name = "\u{1}__ZN3FooD1Ev"]
pub fn Foo_Foo_destructor(this: *mut Foo);
}
impl Foo {
#[inline]
pub unsafe fn destruct(&mut self) {
Foo_Foo_destructor(self)
}
}
thread 'header_gen_destructors_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:130:0
---- header_generate_inline_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/generate-inline.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/generate-inline.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Foo {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
1usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
1usize,
concat!("Alignment of ", stringify!(Foo))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN3Foo3barEv"]
+ #[link_name = "\u{1}__ZN3Foo3barEv"]
pub fn Foo_bar() -> ::std::os::raw::c_int;
}
impl Clone for Foo {
fn clone(&self) -> Self {
*self
}
}
impl Foo {
#[inline]
pub unsafe fn bar() -> ::std::os::raw::c_int {
Foo_bar()
}
}
extern "C" {
- #[link_name = "\u{1}_Z3foov"]
+ #[link_name = "\u{1}__Z3foov"]
pub fn foo() -> ::std::os::raw::c_int;
}
thread 'header_generate_inline_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:131:0
---- header_inner_const_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/inner_const.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/inner_const.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Foo {
pub bar: ::std::os::raw::c_int,
}
extern "C" {
- #[link_name = "\u{1}_ZN3Foo3BOOE"]
+ #[link_name = "\u{1}__ZN3Foo3BOOE"]
pub static mut Foo_BOO: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}_ZN3Foo8whateverE"]
+ #[link_name = "\u{1}__ZN3Foo8whateverE"]
pub static mut Foo_whatever: Foo;
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
4usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
4usize,
concat!("Alignment of ", stringify!(Foo))
);
assert_eq!(
unsafe { &(*(0 as *const Foo)).bar as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Foo),
"::",
stringify!(bar)
)
);
}
impl Clone for Foo {
fn clone(&self) -> Self {
*self
}
}
thread 'header_inner_const_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:142:0
---- header_issue_410_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-410.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-410.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod root {
#[allow(unused_imports)]
use self::super::root;
pub mod JS {
#[allow(unused_imports)]
use self::super::super::root;
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Value {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Value() {
assert_eq!(
::std::mem::size_of::<Value>(),
1usize,
concat!("Size of: ", stringify!(Value))
);
assert_eq!(
::std::mem::align_of::<Value>(),
1usize,
concat!("Alignment of ", stringify!(Value))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN2JS5Value1aE10JSWhyMagic"]
+ #[link_name = "\u{1}__ZN2JS5Value1aE10JSWhyMagic"]
pub fn Value_a(this: *mut root::JS::Value, arg1: root::JSWhyMagic);
}
impl Clone for Value {
fn clone(&self) -> Self {
*self
}
}
impl Value {
#[inline]
pub unsafe fn a(&mut self, arg1: root::JSWhyMagic) {
Value_a(self, arg1)
}
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum JSWhyMagic {}
}
thread 'header_issue_410_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:148:0
---- header_issue_447_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-447.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-447.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod root {
#[allow(unused_imports)]
use self::super::root;
pub mod mozilla {
#[allow(unused_imports)]
use self::super::super::root;
pub mod detail {
#[allow(unused_imports)]
use self::super::super::super::root;
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct GuardObjectNotifier {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_GuardObjectNotifier() {
assert_eq!(
::std::mem::size_of::<GuardObjectNotifier>(),
1usize,
concat!("Size of: ", stringify!(GuardObjectNotifier))
);
assert_eq!(
::std::mem::align_of::<GuardObjectNotifier>(),
1usize,
concat!("Alignment of ", stringify!(GuardObjectNotifier))
);
}
impl Clone for GuardObjectNotifier {
fn clone(&self) -> Self {
*self
}
}
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct JSAutoCompartment {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_JSAutoCompartment() {
assert_eq!(
::std::mem::size_of::<JSAutoCompartment>(),
1usize,
concat!("Size of: ", stringify!(JSAutoCompartment))
);
assert_eq!(
::std::mem::align_of::<JSAutoCompartment>(),
1usize,
concat!("Alignment of ", stringify!(JSAutoCompartment))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN17JSAutoCompartmentC1EN7mozilla6detail19GuardObjectNotifierE"]
+ #[link_name = "\u{1}__ZN17JSAutoCompartmentC1EN7mozilla6detail19GuardObjectNotifierE"]
pub fn JSAutoCompartment_JSAutoCompartment(
this: *mut root::JSAutoCompartment,
arg1: root::mozilla::detail::GuardObjectNotifier,
);
}
impl Clone for JSAutoCompartment {
fn clone(&self) -> Self {
*self
}
}
impl JSAutoCompartment {
#[inline]
pub unsafe fn new(arg1: root::mozilla::detail::GuardObjectNotifier) -> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
JSAutoCompartment_JSAutoCompartment(&mut __bindgen_tmp, arg1);
__bindgen_tmp
}
}
}
thread 'header_issue_447_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:150:0
---- header_issue_574_assertion_failure_in_codegen_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-574-assertion-failure-in-codegen.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct a {
pub _address: u8,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct _bindgen_ty_1 {
pub ar: a,
}
#[test]
fn bindgen_test_layout__bindgen_ty_1() {
assert_eq!(
::std::mem::size_of::<_bindgen_ty_1>(),
1usize,
concat!("Size of: ", stringify!(_bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<_bindgen_ty_1>(),
1usize,
concat!("Alignment of ", stringify!(_bindgen_ty_1))
);
assert_eq!(
unsafe { &(*(0 as *const _bindgen_ty_1)).ar as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(_bindgen_ty_1),
"::",
stringify!(ar)
)
);
}
impl Clone for _bindgen_ty_1 {
fn clone(&self) -> Self {
*self
}
}
extern "C" {
- #[link_name = "\u{1}AutoIdVector"]
+ #[link_name = "\u{1}_AutoIdVector"]
pub static mut AutoIdVector: _bindgen_ty_1;
}
#[test]
fn __bindgen_test_layout_a_open0_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<a>(),
1usize,
concat!("Size of template specialization: ", stringify!(a))
);
assert_eq!(
::std::mem::align_of::<a>(),
1usize,
concat!("Alignment of template specialization: ", stringify!(a))
);
}
thread 'header_issue_574_assertion_failure_in_codegen_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:157:0
---- header_issue_584_stylo_template_analysis_panic_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-584-stylo-template-analysis-panic.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type RefPtr<T> = T;
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct A {
pub _address: u8,
}
pub type A_a = b;
#[test]
fn bindgen_test_layout_A() {
assert_eq!(
::std::mem::size_of::<A>(),
1usize,
concat!("Size of: ", stringify!(A))
);
assert_eq!(
::std::mem::align_of::<A>(),
1usize,
concat!("Alignment of ", stringify!(A))
);
}
impl Clone for A {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
pub struct e<c> {
pub d: RefPtr<c>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<c>>,
}
impl<c> Default for e<c> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct f {
pub _address: u8,
}
#[repr(C)]
pub struct g {
pub h: f,
}
#[test]
fn bindgen_test_layout_g() {
assert_eq!(
::std::mem::size_of::<g>(),
1usize,
concat!("Size of: ", stringify!(g))
);
assert_eq!(
::std::mem::align_of::<g>(),
1usize,
concat!("Alignment of ", stringify!(g))
);
assert_eq!(
unsafe { &(*(0 as *const g)).h as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(g), "::", stringify!(h))
);
}
impl Default for g {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
pub struct b {
pub _base: g,
}
#[test]
fn bindgen_test_layout_b() {
assert_eq!(
::std::mem::size_of::<b>(),
1usize,
concat!("Size of: ", stringify!(b))
);
assert_eq!(
::std::mem::align_of::<b>(),
1usize,
concat!("Alignment of ", stringify!(b))
);
}
impl Default for b {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_Z25Servo_Element_GetSnapshotv"]
+ #[link_name = "\u{1}__Z25Servo_Element_GetSnapshotv"]
pub fn Servo_Element_GetSnapshot() -> A;
}
#[test]
fn __bindgen_test_layout_f_open0_e_open1_int_close1_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<f>(),
1usize,
concat!("Size of template specialization: ", stringify!(f))
);
assert_eq!(
::std::mem::align_of::<f>(),
1usize,
concat!("Alignment of template specialization: ", stringify!(f))
);
}
thread 'header_issue_584_stylo_template_analysis_panic_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:158:0
---- header_issue_654_struct_fn_collision_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-654-struct-fn-collision.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-654-struct-fn-collision.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct foo {
_unused: [u8; 0],
}
extern "C" {
+ #[link_name = "\u{1}_foo"]
pub fn foo() -> ::std::os::raw::c_int;
}
thread 'header_issue_654_struct_fn_collision_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:164:0
---- header_issue_833_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-833.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-833.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
pub struct nsTArray<T> {
pub hdr: *const T,
}
extern "C" {
+ #[link_name = "\u{1}_func"]
pub fn func() -> *mut nsTArray<::std::os::raw::c_int>;
}
thread 'header_issue_833_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:180:0
---- header_issue_833_1_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-833-1.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-833-1.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
pub struct nsTArray {
pub hdr: *const (),
}
extern "C" {
+ #[link_name = "\u{1}_func"]
pub fn func() -> *mut nsTArray;
}
thread 'header_issue_833_1_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:178:0
---- header_issue_801_opaque_sloppiness_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-801-opaque-sloppiness.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-801-opaque-sloppiness.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct A {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct B {
pub _bindgen_opaque_blob: u8,
}
#[test]
fn bindgen_test_layout_B() {
assert_eq!(
::std::mem::size_of::<B>(),
1usize,
concat!("Size of: ", stringify!(B))
);
assert_eq!(
::std::mem::align_of::<B>(),
1usize,
concat!("Alignment of ", stringify!(B))
);
}
impl Clone for B {
fn clone(&self) -> Self {
*self
}
}
extern "C" {
- #[link_name = "\u{1}_ZN1B1aE"]
+ #[link_name = "\u{1}__ZN1B1aE"]
pub static mut B_a: A;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct C {
pub b: B,
}
#[test]
fn bindgen_test_layout_C() {
assert_eq!(
::std::mem::size_of::<C>(),
1usize,
concat!("Size of: ", stringify!(C))
);
assert_eq!(
::std::mem::align_of::<C>(),
1usize,
concat!("Alignment of ", stringify!(C))
);
assert_eq!(
unsafe { &(*(0 as *const C)).b as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(C), "::", stringify!(b))
);
}
impl Clone for C {
fn clone(&self) -> Self {
*self
}
}
thread 'header_issue_801_opaque_sloppiness_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:174:0
---- header_issue_807_opaque_types_methods_being_generated_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-807-opaque-types-methods-being-generated.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct Pupper {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Pupper() {
assert_eq!(
::std::mem::size_of::<Pupper>(),
1usize,
concat!("Size of: ", stringify!(Pupper))
);
assert_eq!(
::std::mem::align_of::<Pupper>(),
1usize,
concat!("Alignment of ", stringify!(Pupper))
);
}
impl Clone for Pupper {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct Doggo {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Doggo() {
assert_eq!(
::std::mem::size_of::<Doggo>(),
1usize,
concat!("Size of: ", stringify!(Doggo))
);
assert_eq!(
::std::mem::align_of::<Doggo>(),
1usize,
concat!("Alignment of ", stringify!(Doggo))
);
}
impl Clone for Doggo {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct SuchWow {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_SuchWow() {
assert_eq!(
::std::mem::size_of::<SuchWow>(),
1usize,
concat!("Size of: ", stringify!(SuchWow))
);
assert_eq!(
::std::mem::align_of::<SuchWow>(),
1usize,
concat!("Alignment of ", stringify!(SuchWow))
);
}
impl Clone for SuchWow {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct Opaque {
pub _bindgen_opaque_blob: u8,
}
#[test]
fn bindgen_test_layout_Opaque() {
assert_eq!(
::std::mem::size_of::<Opaque>(),
1usize,
concat!("Size of: ", stringify!(Opaque))
);
assert_eq!(
::std::mem::align_of::<Opaque>(),
1usize,
concat!("Alignment of ", stringify!(Opaque))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN6Opaque17eleven_out_of_tenEv"]
+ #[link_name = "\u{1}__ZN6Opaque17eleven_out_of_tenEv"]
pub fn Opaque_eleven_out_of_ten(this: *mut Opaque) -> SuchWow;
}
extern "C" {
- #[link_name = "\u{1}_ZN6OpaqueC1E6Pupper"]
+ #[link_name = "\u{1}__ZN6OpaqueC1E6Pupper"]
pub fn Opaque_Opaque(this: *mut Opaque, pup: Pupper);
}
impl Clone for Opaque {
fn clone(&self) -> Self {
*self
}
}
impl Opaque {
#[inline]
pub unsafe fn eleven_out_of_ten(&mut self) -> SuchWow {
Opaque_eleven_out_of_ten(self)
}
#[inline]
pub unsafe fn new(pup: Pupper) -> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
Opaque_Opaque(&mut __bindgen_tmp, pup);
__bindgen_tmp
}
}
extern "C" {
- #[link_name = "\u{1}_ZN6Opaque11MAJESTIC_AFE"]
+ #[link_name = "\u{1}__ZN6Opaque11MAJESTIC_AFE"]
pub static mut Opaque_MAJESTIC_AF: Doggo;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct Whitelisted {
pub some_member: Opaque,
}
#[test]
fn bindgen_test_layout_Whitelisted() {
assert_eq!(
::std::mem::size_of::<Whitelisted>(),
1usize,
concat!("Size of: ", stringify!(Whitelisted))
);
assert_eq!(
::std::mem::align_of::<Whitelisted>(),
1usize,
concat!("Alignment of ", stringify!(Whitelisted))
);
assert_eq!(
unsafe { &(*(0 as *const Whitelisted)).some_member as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Whitelisted),
"::",
stringify!(some_member)
)
);
}
impl Clone for Whitelisted {
fn clone(&self) -> Self {
*self
}
}
thread 'header_issue_807_opaque_types_methods_being_generated_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:175:0
---- header_issue_888_enum_var_decl_jump_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-888-enum-var-decl-jump.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-888-enum-var-decl-jump.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod root {
#[allow(unused_imports)]
use self::super::root;
pub mod Halide {
#[allow(unused_imports)]
use self::super::super::root;
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Type {
pub _address: u8,
}
extern "C" {
- #[link_name = "\u{1}_ZN6Halide4Type1bE"]
+ #[link_name = "\u{1}__ZN6Halide4Type1bE"]
pub static mut Type_b: root::a;
}
#[test]
fn bindgen_test_layout_Type() {
assert_eq!(
::std::mem::size_of::<Type>(),
1usize,
concat!("Size of: ", stringify!(Type))
);
assert_eq!(
::std::mem::align_of::<Type>(),
1usize,
concat!("Alignment of ", stringify!(Type))
);
}
impl Clone for Type {
fn clone(&self) -> Self {
*self
}
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum a {}
}
thread 'header_issue_888_enum_var_decl_jump_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:183:0
---- header_issue_848_replacement_system_include_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/issue-848-replacement-system-include.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/issue-848-replacement-system-include.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/// This is intended to replace another type, but won't if we treat this include
/// as a system include, because clang doesn't parse comments there.
///
/// See #848.
///
/// <div rustbindgen replaces="nsTArray"></div>
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nsTArray<T> {
pub m: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for nsTArray<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
+ #[link_name = "\u{1}_func"]
pub fn func() -> *mut nsTArray<::std::os::raw::c_int>;
}
thread 'header_issue_848_replacement_system_include_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:182:0
---- header_keywords_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/keywords.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/keywords.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
- #[link_name = "\u{1}u8"]
+ #[link_name = "\u{1}_u8"]
pub static mut u8: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}u16"]
+ #[link_name = "\u{1}_u16"]
pub static mut u16: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}u32"]
+ #[link_name = "\u{1}_u32"]
pub static mut u32: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}u64"]
+ #[link_name = "\u{1}_u64"]
pub static mut u64: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}i8"]
+ #[link_name = "\u{1}_i8"]
pub static mut i8: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}i16"]
+ #[link_name = "\u{1}_i16"]
pub static mut i16: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}i32"]
+ #[link_name = "\u{1}_i32"]
pub static mut i32: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}i64"]
+ #[link_name = "\u{1}_i64"]
pub static mut i64: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}f32"]
+ #[link_name = "\u{1}_f32"]
pub static mut f32: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}f64"]
+ #[link_name = "\u{1}_f64"]
pub static mut f64: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}usize"]
+ #[link_name = "\u{1}_usize"]
pub static mut usize: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}isize"]
+ #[link_name = "\u{1}_isize"]
pub static mut isize: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}as"]
+ #[link_name = "\u{1}_as"]
pub static mut as_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}box"]
+ #[link_name = "\u{1}_box"]
pub static mut box_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}crate"]
+ #[link_name = "\u{1}_crate"]
pub static mut crate_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}false"]
+ #[link_name = "\u{1}_false"]
pub static mut false_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}fn"]
+ #[link_name = "\u{1}_fn"]
pub static mut fn_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}impl"]
+ #[link_name = "\u{1}_impl"]
pub static mut impl_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}in"]
+ #[link_name = "\u{1}_in"]
pub static mut in_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}let"]
+ #[link_name = "\u{1}_let"]
pub static mut let_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}loop"]
+ #[link_name = "\u{1}_loop"]
pub static mut loop_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}match"]
+ #[link_name = "\u{1}_match"]
pub static mut match_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}mod"]
+ #[link_name = "\u{1}_mod"]
pub static mut mod_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}move"]
+ #[link_name = "\u{1}_move"]
pub static mut move_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}mut"]
+ #[link_name = "\u{1}_mut"]
pub static mut mut_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}pub"]
+ #[link_name = "\u{1}_pub"]
pub static mut pub_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}ref"]
+ #[link_name = "\u{1}_ref"]
pub static mut ref_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}self"]
+ #[link_name = "\u{1}_self"]
pub static mut self_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}Self"]
+ #[link_name = "\u{1}_Self"]
pub static mut Self_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}super"]
+ #[link_name = "\u{1}_super"]
pub static mut super_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}trait"]
+ #[link_name = "\u{1}_trait"]
pub static mut trait_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}true"]
+ #[link_name = "\u{1}_true"]
pub static mut true_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}type"]
+ #[link_name = "\u{1}_type"]
pub static mut type_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}unsafe"]
+ #[link_name = "\u{1}_unsafe"]
pub static mut unsafe_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}use"]
+ #[link_name = "\u{1}_use"]
pub static mut use_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}where"]
+ #[link_name = "\u{1}_where"]
pub static mut where_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}abstract"]
+ #[link_name = "\u{1}_abstract"]
pub static mut abstract_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}alignof"]
+ #[link_name = "\u{1}_alignof"]
pub static mut alignof_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}become"]
+ #[link_name = "\u{1}_become"]
pub static mut become_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}final"]
+ #[link_name = "\u{1}_final"]
pub static mut final_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}macro"]
+ #[link_name = "\u{1}_macro"]
pub static mut macro_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}offsetof"]
+ #[link_name = "\u{1}_offsetof"]
pub static mut offsetof_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}override"]
+ #[link_name = "\u{1}_override"]
pub static mut override_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}priv"]
+ #[link_name = "\u{1}_priv"]
pub static mut priv_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}proc"]
+ #[link_name = "\u{1}_proc"]
pub static mut proc_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}pure"]
+ #[link_name = "\u{1}_pure"]
pub static mut pure_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}unsized"]
+ #[link_name = "\u{1}_unsized"]
pub static mut unsized_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}virtual"]
+ #[link_name = "\u{1}_virtual"]
pub static mut virtual_: ::std::os::raw::c_int;
}
extern "C" {
- #[link_name = "\u{1}yield"]
+ #[link_name = "\u{1}_yield"]
pub static mut yield_: ::std::os::raw::c_int;
}
thread 'header_keywords_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:189:0
---- header_macro_expr_uncommon_token_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/macro-expr-uncommon-token.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/macro-expr-uncommon-token.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const MODBUS_WOOT: ::std::os::raw::c_uint = 3;
extern "C" {
+ #[link_name = "\u{1}_foo"]
pub fn foo();
}
thread 'header_macro_expr_uncommon_token_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:203:0
---- header_method_mangling_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/method-mangling.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/method-mangling.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Foo {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
1usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
1usize,
concat!("Alignment of ", stringify!(Foo))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN3Foo4typeEv"]
+ #[link_name = "\u{1}__ZN3Foo4typeEv"]
pub fn Foo_type(this: *mut Foo) -> ::std::os::raw::c_int;
}
impl Clone for Foo {
fn clone(&self) -> Self {
*self
}
}
impl Foo {
#[inline]
pub unsafe fn type_(&mut self) -> ::std::os::raw::c_int {
Foo_type(self)
}
}
thread 'header_method_mangling_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:213:0
---- header_namespace_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/namespace.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/namespace.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod root {
#[allow(unused_imports)]
use self::super::root;
extern "C" {
- #[link_name = "\u{1}_Z9top_levelv"]
+ #[link_name = "\u{1}__Z9top_levelv"]
pub fn top_level();
}
pub mod whatever {
#[allow(unused_imports)]
use self::super::super::root;
pub type whatever_int_t = ::std::os::raw::c_int;
extern "C" {
- #[link_name = "\u{1}_ZN8whatever11in_whateverEv"]
+ #[link_name = "\u{1}__ZN8whatever11in_whateverEv"]
pub fn in_whatever();
}
}
pub mod _bindgen_mod_id_13 {
#[allow(unused_imports)]
use self::super::super::root;
extern "C" {
- #[link_name = "\u{1}_ZN12_GLOBAL__N_13fooEv"]
+ #[link_name = "\u{1}__ZN12_GLOBAL__N_13fooEv"]
pub fn foo();
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct A {
pub b: root::whatever::whatever_int_t,
}
#[test]
fn bindgen_test_layout_A() {
assert_eq!(
::std::mem::size_of::<A>(),
4usize,
concat!("Size of: ", stringify!(A))
);
assert_eq!(
::std::mem::align_of::<A>(),
4usize,
concat!("Alignment of ", stringify!(A))
);
assert_eq!(
unsafe { &(*(0 as *const A)).b as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(A), "::", stringify!(b))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN12_GLOBAL__N_11A20lets_hope_this_worksEv"]
+ #[link_name = "\u{1}__ZN12_GLOBAL__N_11A20lets_hope_this_worksEv"]
pub fn A_lets_hope_this_works(
this: *mut root::_bindgen_mod_id_13::A,
) -> ::std::os::raw::c_int;
}
impl Clone for A {
fn clone(&self) -> Self {
*self
}
}
impl A {
#[inline]
pub unsafe fn lets_hope_this_works(&mut self) -> ::std::os::raw::c_int {
A_lets_hope_this_works(self)
}
}
}
#[repr(C)]
#[derive(Debug)]
pub struct C<T> {
pub _base: root::_bindgen_mod_id_13::A,
pub m_c: T,
pub m_c_ptr: *mut T,
pub m_c_arr: [T; 10usize],
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for C<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
pub mod w {
#[allow(unused_imports)]
use self::super::super::root;
pub type whatever_int_t = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug)]
pub struct D<T> {
pub m_c: root::C<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for D<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_ZN1w3hehEv"]
+ #[link_name = "\u{1}__ZN1w3hehEv"]
pub fn heh() -> root::w::whatever_int_t;
}
extern "C" {
- #[link_name = "\u{1}_ZN1w3fooEv"]
+ #[link_name = "\u{1}__ZN1w3fooEv"]
pub fn foo() -> root::C<::std::os::raw::c_int>;
}
extern "C" {
- #[link_name = "\u{1}_ZN1w4barrEv"]
+ #[link_name = "\u{1}__ZN1w4barrEv"]
pub fn barr() -> root::C<f32>;
}
}
}
thread 'header_namespace_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:218:0
---- header_nested_vtable_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/nested_vtable.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/nested_vtable.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
pub struct nsISupports__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct nsISupports {
pub vtable_: *const nsISupports__bindgen_vtable,
}
#[test]
fn bindgen_test_layout_nsISupports() {
assert_eq!(
::std::mem::size_of::<nsISupports>(),
8usize,
concat!("Size of: ", stringify!(nsISupports))
);
assert_eq!(
::std::mem::align_of::<nsISupports>(),
8usize,
concat!("Alignment of ", stringify!(nsISupports))
);
}
impl Clone for nsISupports {
fn clone(&self) -> Self {
*self
}
}
impl Default for nsISupports {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_ZN11nsISupports14QueryInterfaceEv"]
+ #[link_name = "\u{1}__ZN11nsISupports14QueryInterfaceEv"]
pub fn nsISupports_QueryInterface(this: *mut ::std::os::raw::c_void) -> *mut nsISupports;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct nsIRunnable {
pub _base: nsISupports,
}
#[test]
fn bindgen_test_layout_nsIRunnable() {
assert_eq!(
::std::mem::size_of::<nsIRunnable>(),
8usize,
concat!("Size of: ", stringify!(nsIRunnable))
);
assert_eq!(
::std::mem::align_of::<nsIRunnable>(),
8usize,
concat!("Alignment of ", stringify!(nsIRunnable))
);
}
impl Clone for nsIRunnable {
fn clone(&self) -> Self {
*self
}
}
impl Default for nsIRunnable {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Runnable {
pub _base: nsIRunnable,
}
#[test]
fn bindgen_test_layout_Runnable() {
assert_eq!(
::std::mem::size_of::<Runnable>(),
8usize,
concat!("Size of: ", stringify!(Runnable))
);
assert_eq!(
::std::mem::align_of::<Runnable>(),
8usize,
concat!("Alignment of ", stringify!(Runnable))
);
}
impl Clone for Runnable {
fn clone(&self) -> Self {
*self
}
}
impl Default for Runnable {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
thread 'header_nested_vtable_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:220:0
---- header_objc_class_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/objc_class.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/objc_class.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
extern "C" {
- #[link_name = "\u{1}fooVar"]
+ #[link_name = "\u{1}_fooVar"]
pub static mut fooVar: *mut id;
}
pub trait Foo {
unsafe fn method(self);
}
impl Foo for id {
unsafe fn method(self) {
msg_send!(self, method)
}
}
thread 'header_objc_class_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:234:0
---- header_objc_interface_type_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/objc_interface_type.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/objc_interface_type.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
pub trait Foo {}
impl Foo for id {}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct FooStruct {
pub foo: *mut id,
}
#[test]
fn bindgen_test_layout_FooStruct() {
assert_eq!(
::std::mem::size_of::<FooStruct>(),
8usize,
concat!("Size of: ", stringify!(FooStruct))
);
assert_eq!(
::std::mem::align_of::<FooStruct>(),
8usize,
concat!("Alignment of ", stringify!(FooStruct))
);
assert_eq!(
unsafe { &(*(0 as *const FooStruct)).foo as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(FooStruct),
"::",
stringify!(foo)
)
);
}
impl Clone for FooStruct {
fn clone(&self) -> Self {
*self
}
}
impl Default for FooStruct {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
+ #[link_name = "\u{1}_fooFunc"]
pub fn fooFunc(foo: id);
}
extern "C" {
- #[link_name = "\u{1}kFoo"]
+ #[link_name = "\u{1}_kFoo"]
pub static mut kFoo: *const id;
}
thread 'header_objc_interface_type_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:237:0
---- header_objc_sel_and_id_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/objc_sel_and_id.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/objc_sel_and_id.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
extern "C" {
- #[link_name = "\u{1}object"]
+ #[link_name = "\u{1}_object"]
pub static mut object: id;
}
extern "C" {
- #[link_name = "\u{1}selector"]
+ #[link_name = "\u{1}_selector"]
pub static mut selector: objc::runtime::Sel;
}
extern "C" {
+ #[link_name = "\u{1}_f"]
pub fn f(object: id, selector: objc::runtime::Sel);
}
thread 'header_objc_sel_and_id_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:242:0
---- header_opaque_tracing_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/opaque-tracing.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/opaque-tracing.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
- #[link_name = "\u{1}_Z3fooP9Container"]
+ #[link_name = "\u{1}__Z3fooP9Container"]
pub fn foo(c: *mut Container);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct Container {
pub _bindgen_opaque_blob: [u32; 2usize],
}
#[test]
fn bindgen_test_layout_Container() {
assert_eq!(
::std::mem::size_of::<Container>(),
8usize,
concat!("Size of: ", stringify!(Container))
);
assert_eq!(
::std::mem::align_of::<Container>(),
4usize,
concat!("Alignment of ", stringify!(Container))
);
}
impl Clone for Container {
fn clone(&self) -> Self {
*self
}
}
thread 'header_opaque_tracing_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:250:0
---- header_overloading_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/overloading.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/overloading.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
- #[link_name = "\u{1}_Z8Evaluatec"]
+ #[link_name = "\u{1}__Z8Evaluatec"]
pub fn Evaluate(r: ::std::os::raw::c_char) -> bool;
}
extern "C" {
- #[link_name = "\u{1}_Z8Evaluateii"]
+ #[link_name = "\u{1}__Z8Evaluateii"]
pub fn Evaluate1(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool;
}
extern "C" {
- #[link_name = "\u{1}_ZN3foo10MyFunctionEv"]
+ #[link_name = "\u{1}__ZN3foo10MyFunctionEv"]
pub fn foo_MyFunction();
}
extern "C" {
- #[link_name = "\u{1}_ZN3bar10MyFunctionEv"]
+ #[link_name = "\u{1}__ZN3bar10MyFunctionEv"]
pub fn bar_MyFunction();
}
thread 'header_overloading_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:255:0
---- header_partial_specialization_and_inheritance_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/partial-specialization-and-inheritance.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Base {
pub _address: u8,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Derived {
pub b: bool,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Usage {
pub _address: u8,
}
extern "C" {
- #[link_name = "\u{1}_ZN5Usage13static_memberE"]
+ #[link_name = "\u{1}__ZN5Usage13static_memberE"]
pub static mut Usage_static_member: [u32; 2usize];
}
#[test]
fn bindgen_test_layout_Usage() {
assert_eq!(
::std::mem::size_of::<Usage>(),
1usize,
concat!("Size of: ", stringify!(Usage))
);
assert_eq!(
::std::mem::align_of::<Usage>(),
1usize,
concat!("Alignment of ", stringify!(Usage))
);
}
impl Clone for Usage {
fn clone(&self) -> Self {
*self
}
}
thread 'header_partial_specialization_and_inheritance_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:256:0
---- header_redeclaration_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/redeclaration.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/redeclaration.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
+ #[link_name = "\u{1}_foo"]
pub fn foo();
}
thread 'header_redeclaration_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:261:0
---- header_public_dtor_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/public-dtor.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/public-dtor.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default)]
pub struct cv_String {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_cv_String() {
assert_eq!(
::std::mem::size_of::<cv_String>(),
1usize,
concat!("Size of: ", stringify!(cv_String))
);
assert_eq!(
::std::mem::align_of::<cv_String>(),
1usize,
concat!("Alignment of ", stringify!(cv_String))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN2cv6StringD1Ev"]
+ #[link_name = "\u{1}__ZN2cv6StringD1Ev"]
pub fn cv_String_String_destructor(this: *mut cv_String);
}
impl cv_String {
#[inline]
pub unsafe fn destruct(&mut self) {
cv_String_String_destructor(self)
}
}
thread 'header_public_dtor_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:260:0
---- header_ref_argument_array_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/ref_argument_array.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/ref_argument_array.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const NSID_LENGTH: ::std::os::raw::c_uint = 10;
#[repr(C)]
pub struct nsID__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct nsID {
pub vtable_: *const nsID__bindgen_vtable,
}
#[test]
fn bindgen_test_layout_nsID() {
assert_eq!(
::std::mem::size_of::<nsID>(),
8usize,
concat!("Size of: ", stringify!(nsID))
);
assert_eq!(
::std::mem::align_of::<nsID>(),
8usize,
concat!("Alignment of ", stringify!(nsID))
);
}
impl Clone for nsID {
fn clone(&self) -> Self {
*self
}
}
impl Default for nsID {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_ZN4nsID16ToProvidedStringERA10_c"]
+ #[link_name = "\u{1}__ZN4nsID16ToProvidedStringERA10_c"]
pub fn nsID_ToProvidedString(
this: *mut ::std::os::raw::c_void,
aDest: *mut [::std::os::raw::c_char; 10usize],
);
}
thread 'header_ref_argument_array_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:262:0
---- header_resolved_type_def_function_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/resolved_type_def_function.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/resolved_type_def_function.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type FuncType = ::std::option::Option<unsafe extern "C" fn()>;
extern "C" {
+ #[link_name = "\u{1}_Func"]
pub fn Func();
}
thread 'header_resolved_type_def_function_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:267:0
---- header_template_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/template.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/template.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct Foo<T> {
pub m_member: T,
pub m_member_ptr: *mut T,
pub m_member_arr: [T; 1usize],
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for Foo<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct B<T> {
pub m_member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for B<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_Z3bar3FooIiiE"]
+ #[link_name = "\u{1}__Z3bar3FooIiiE"]
pub fn bar(foo: Foo<::std::os::raw::c_int>);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mozilla_Foo {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
pub struct C {
pub mB: B<::std::os::raw::c_uint>,
pub mBConstPtr: B<*const ::std::os::raw::c_int>,
pub mBConstStructPtr: B<*const mozilla_Foo>,
pub mBConstStructPtrArray: B<[*const mozilla_Foo; 1usize]>,
pub mBConst: B<::std::os::raw::c_int>,
pub mBVolatile: B<::std::os::raw::c_int>,
pub mBConstBool: B<bool>,
pub mBConstChar: B<u16>,
pub mBArray: B<[::std::os::raw::c_int; 1usize]>,
pub mBPtrArray: B<[*mut ::std::os::raw::c_int; 1usize]>,
pub mBArrayPtr: B<*mut [::std::os::raw::c_int; 1usize]>,
pub mBRef: B<*mut ::std::os::raw::c_int>,
pub mBConstRef: B<*const ::std::os::raw::c_int>,
pub mPtrRef: B<*mut *mut ::std::os::raw::c_int>,
pub mArrayRef: B<*mut [::std::os::raw::c_int; 1usize]>,
}
#[test]
fn bindgen_test_layout_C() {
assert_eq!(
::std::mem::size_of::<C>(),
96usize,
concat!("Size of: ", stringify!(C))
);
assert_eq!(
::std::mem::align_of::<C>(),
8usize,
concat!("Alignment of ", stringify!(C))
);
assert_eq!(
unsafe { &(*(0 as *const C)).mB as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(C), "::", stringify!(mB))
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBConstPtr as *const _ as usize },
8usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBConstPtr)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBConstStructPtr as *const _ as usize },
16usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBConstStructPtr)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBConstStructPtrArray as *const _ as usize },
24usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBConstStructPtrArray)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBConst as *const _ as usize },
32usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBConst)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBVolatile as *const _ as usize },
36usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBVolatile)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBConstBool as *const _ as usize },
40usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBConstBool)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBConstChar as *const _ as usize },
42usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBConstChar)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBArray as *const _ as usize },
44usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBArray)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBPtrArray as *const _ as usize },
48usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBPtrArray)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBArrayPtr as *const _ as usize },
56usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBArrayPtr)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBRef as *const _ as usize },
64usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBRef)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mBConstRef as *const _ as usize },
72usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mBConstRef)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mPtrRef as *const _ as usize },
80usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mPtrRef)
)
);
assert_eq!(
unsafe { &(*(0 as *const C)).mArrayRef as *const _ as usize },
88usize,
concat!(
"Alignment of field: ",
stringify!(C),
"::",
stringify!(mArrayRef)
)
);
}
impl Clone for C {
fn clone(&self) -> Self {
*self
}
}
impl Default for C {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct D {
pub m_foo: D_MyFoo,
}
pub type D_MyFoo = Foo<::std::os::raw::c_int>;
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct D_U<Z> {
pub m_nested_foo: D_MyFoo,
pub m_baz: Z,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<Z>>,
}
impl<Z> Default for D_U<Z> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
impl Default for D {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Rooted<T> {
pub prev: *mut T,
pub next: *mut Rooted<*mut ::std::os::raw::c_void>,
pub ptr: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for Rooted<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
pub struct RootedContainer {
pub root: Rooted<*mut ::std::os::raw::c_void>,
}
#[test]
fn bindgen_test_layout_RootedContainer() {
assert_eq!(
::std::mem::size_of::<RootedContainer>(),
24usize,
concat!("Size of: ", stringify!(RootedContainer))
);
assert_eq!(
::std::mem::align_of::<RootedContainer>(),
8usize,
concat!("Alignment of ", stringify!(RootedContainer))
);
assert_eq!(
unsafe { &(*(0 as *const RootedContainer)).root as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(RootedContainer),
"::",
stringify!(root)
)
);
}
impl Clone for RootedContainer {
fn clone(&self) -> Self {
*self
}
}
impl Default for RootedContainer {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
pub type WithDtorIntFwd = WithDtor<::std::os::raw::c_int>;
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct WithDtor<T> {
pub member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for WithDtor<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct PODButContainsDtor {
pub member: WithDtorIntFwd,
}
#[test]
fn bindgen_test_layout_PODButContainsDtor() {
assert_eq!(
::std::mem::size_of::<PODButContainsDtor>(),
4usize,
concat!("Size of: ", stringify!(PODButContainsDtor))
);
assert_eq!(
::std::mem::align_of::<PODButContainsDtor>(),
4usize,
concat!("Alignment of ", stringify!(PODButContainsDtor))
);
assert_eq!(
unsafe { &(*(0 as *const PODButContainsDtor)).member as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(PODButContainsDtor),
"::",
stringify!(member)
)
);
}
impl Default for PODButContainsDtor {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
/// <div rustbindgen opaque>
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Opaque {}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct POD {
pub opaque_member: u32,
}
#[test]
fn bindgen_test_layout_POD() {
assert_eq!(
::std::mem::size_of::<POD>(),
4usize,
concat!("Size of: ", stringify!(POD))
);
assert_eq!(
::std::mem::align_of::<POD>(),
4usize,
concat!("Alignment of ", stringify!(POD))
);
assert_eq!(
unsafe { &(*(0 as *const POD)).opaque_member as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(POD),
"::",
stringify!(opaque_member)
)
);
}
impl Clone for POD {
fn clone(&self) -> Self {
*self
}
}
/// <div rustbindgen replaces="NestedReplaced"></div>
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NestedReplaced<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for NestedReplaced<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NestedBase<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for NestedBase<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NestedContainer<T> {
pub c: T,
pub nested: NestedReplaced<T>,
pub inc: Incomplete<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for NestedContainer<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Incomplete<T> {
pub d: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for Incomplete<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct Untemplated {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Untemplated() {
assert_eq!(
::std::mem::size_of::<Untemplated>(),
1usize,
concat!("Size of: ", stringify!(Untemplated))
);
assert_eq!(
::std::mem::align_of::<Untemplated>(),
1usize,
concat!("Alignment of ", stringify!(Untemplated))
);
}
impl Clone for Untemplated {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Templated {
pub m_untemplated: Untemplated,
}
/// 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, Hash, PartialEq, Eq)]
pub struct ReplacedWithoutDestructor<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for ReplacedWithoutDestructor<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct ShouldNotBeCopiable<T> {
pub m_member: ReplacedWithoutDestructor<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for ShouldNotBeCopiable<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct ShouldNotBeCopiableAsWell<U> {
pub m_member: ReplacedWithoutDestructorFwd<U>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>,
}
impl<U> Default for ShouldNotBeCopiableAsWell<U> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
/// 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, Hash, PartialEq, Eq)]
pub struct ReplacedWithoutDestructorFwd<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for ReplacedWithoutDestructorFwd<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[test]
fn __bindgen_test_layout_Foo_open0_int_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<Foo<::std::os::raw::c_int>>(),
24usize,
concat!(
"Size of template specialization: ",
stringify!(Foo<::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<Foo<::std::os::raw::c_int>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(Foo<::std::os::raw::c_int>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_unsigned_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<::std::os::raw::c_uint>>(),
4usize,
concat!(
"Size of template specialization: ",
stringify!(B<::std::os::raw::c_uint>)
)
);
assert_eq!(
::std::mem::align_of::<B<::std::os::raw::c_uint>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<::std::os::raw::c_uint>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_ptr_const_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<*const ::std::os::raw::c_int>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(B<*const ::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<B<*const ::std::os::raw::c_int>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<*const ::std::os::raw::c_int>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_ptr_const_mozilla__Foo_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<*const mozilla_Foo>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(B<*const mozilla_Foo>)
)
);
assert_eq!(
::std::mem::align_of::<B<*const mozilla_Foo>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<*const mozilla_Foo>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_array1_ptr_const_mozilla__Foo_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<[*const mozilla_Foo; 1usize]>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(B<[*const mozilla_Foo; 1usize]>)
)
);
assert_eq!(
::std::mem::align_of::<B<[*const mozilla_Foo; 1usize]>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<[*const mozilla_Foo; 1usize]>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_const_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<::std::os::raw::c_int>>(),
4usize,
concat!(
"Size of template specialization: ",
stringify!(B<::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<B<::std::os::raw::c_int>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<::std::os::raw::c_int>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_volatile_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<::std::os::raw::c_int>>(),
4usize,
concat!(
"Size of template specialization: ",
stringify!(B<::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<B<::std::os::raw::c_int>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<::std::os::raw::c_int>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_const_bool_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<bool>>(),
1usize,
concat!("Size of template specialization: ", stringify!(B<bool>))
);
assert_eq!(
::std::mem::align_of::<B<bool>>(),
1usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<bool>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_const_char16_t_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<u16>>(),
2usize,
concat!("Size of template specialization: ", stringify!(B<u16>))
);
assert_eq!(
::std::mem::align_of::<B<u16>>(),
2usize,
concat!("Alignment of template specialization: ", stringify!(B<u16>))
);
}
#[test]
fn __bindgen_test_layout_B_open0_array1_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<[::std::os::raw::c_int; 1usize]>>(),
4usize,
concat!(
"Size of template specialization: ",
stringify!(B<[::std::os::raw::c_int; 1usize]>)
)
);
assert_eq!(
::std::mem::align_of::<B<[::std::os::raw::c_int; 1usize]>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<[::std::os::raw::c_int; 1usize]>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_array1_ptr_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<[*mut ::std::os::raw::c_int; 1usize]>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(B<[*mut ::std::os::raw::c_int; 1usize]>)
)
);
assert_eq!(
::std::mem::align_of::<B<[*mut ::std::os::raw::c_int; 1usize]>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<[*mut ::std::os::raw::c_int; 1usize]>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_ptr_array1_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<*mut [::std::os::raw::c_int; 1usize]>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(B<*mut [::std::os::raw::c_int; 1usize]>)
)
);
assert_eq!(
::std::mem::align_of::<B<*mut [::std::os::raw::c_int; 1usize]>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<*mut [::std::os::raw::c_int; 1usize]>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_ref_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<*mut ::std::os::raw::c_int>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(B<*mut ::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<B<*mut ::std::os::raw::c_int>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<*mut ::std::os::raw::c_int>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_ref_const_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<*const ::std::os::raw::c_int>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(B<*const ::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<B<*const ::std::os::raw::c_int>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<*const ::std::os::raw::c_int>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_ref_ptr_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<*mut *mut ::std::os::raw::c_int>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(B<*mut *mut ::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<B<*mut *mut ::std::os::raw::c_int>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<*mut *mut ::std::os::raw::c_int>)
)
);
}
#[test]
fn __bindgen_test_layout_B_open0_ref_array1_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<B<*mut [::std::os::raw::c_int; 1usize]>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(B<*mut [::std::os::raw::c_int; 1usize]>)
)
);
assert_eq!(
::std::mem::align_of::<B<*mut [::std::os::raw::c_int; 1usize]>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(B<*mut [::std::os::raw::c_int; 1usize]>)
)
);
}
#[test]
fn __bindgen_test_layout_Foo_open0_int_int_close0_instantiation_1() {
assert_eq!(
::std::mem::size_of::<Foo<::std::os::raw::c_int>>(),
24usize,
concat!(
"Size of template specialization: ",
stringify!(Foo<::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<Foo<::std::os::raw::c_int>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(Foo<::std::os::raw::c_int>)
)
);
}
#[test]
fn __bindgen_test_layout_Rooted_open0_ptr_void_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<Rooted<*mut ::std::os::raw::c_void>>(),
24usize,
concat!(
"Size of template specialization: ",
stringify!(Rooted<*mut ::std::os::raw::c_void>)
)
);
assert_eq!(
::std::mem::align_of::<Rooted<*mut ::std::os::raw::c_void>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(Rooted<*mut ::std::os::raw::c_void>)
)
);
}
#[test]
fn __bindgen_test_layout_Rooted_open0_ptr_void_close0_instantiation_1() {
assert_eq!(
::std::mem::size_of::<Rooted<*mut ::std::os::raw::c_void>>(),
24usize,
concat!(
"Size of template specialization: ",
stringify!(Rooted<*mut ::std::os::raw::c_void>)
)
);
assert_eq!(
::std::mem::align_of::<Rooted<*mut ::std::os::raw::c_void>>(),
8usize,
concat!(
"Alignment of template specialization: ",
stringify!(Rooted<*mut ::std::os::raw::c_void>)
)
);
}
#[test]
fn __bindgen_test_layout_WithDtor_open0_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<WithDtor<::std::os::raw::c_int>>(),
4usize,
concat!(
"Size of template specialization: ",
stringify!(WithDtor<::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<WithDtor<::std::os::raw::c_int>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify!(WithDtor<::std::os::raw::c_int>)
)
);
}
thread 'header_template_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:309:0
---- header_type_referenced_by_whitelisted_function_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/type-referenced-by-whitelisted-function.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/type-referenced-by-whitelisted-function.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct dl_phdr_info {
pub x: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_dl_phdr_info() {
assert_eq!(
::std::mem::size_of::<dl_phdr_info>(),
4usize,
concat!("Size of: ", stringify!(dl_phdr_info))
);
assert_eq!(
::std::mem::align_of::<dl_phdr_info>(),
4usize,
concat!("Alignment of ", stringify!(dl_phdr_info))
);
assert_eq!(
unsafe { &(*(0 as *const dl_phdr_info)).x as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(dl_phdr_info),
"::",
stringify!(x)
)
);
}
impl Clone for dl_phdr_info {
fn clone(&self) -> Self {
*self
}
}
extern "C" {
+ #[link_name = "\u{1}_dl_iterate_phdr"]
pub fn dl_iterate_phdr(arg1: *mut dl_phdr_info) -> ::std::os::raw::c_int;
}
thread 'header_type_referenced_by_whitelisted_function_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:317:0
---- header_typedefd_array_as_function_arg_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/typedefd-array-as-function-arg.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/typedefd-array-as-function-arg.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type myVector3 = [f32; 3usize];
extern "C" {
+ #[link_name = "\u{1}_modifyVectorFunc"]
pub fn modifyVectorFunc(v: *mut f32);
}
thread 'header_typedefd_array_as_function_arg_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:321:0
---- header_union_bitfield_1_0_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/union_bitfield_1_0.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/union_bitfield_1_0.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[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()
}
}
impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
}
impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
true
}
}
impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct U4 {
pub _bitfield_1: __BindgenUnionField<u8>,
pub bindgen_union_field: u32,
}
#[test]
fn bindgen_test_layout_U4() {
assert_eq!(
::std::mem::size_of::<U4>(),
4usize,
concat!("Size of: ", stringify!(U4))
);
assert_eq!(
::std::mem::align_of::<U4>(),
4usize,
concat!("Alignment of ", stringify!(U4))
);
}
impl Clone for U4 {
fn clone(&self) -> Self {
*self
}
}
impl U4 {
#[inline]
pub fn derp(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
::std::ptr::copy_nonoverlapping(
&self._bitfield_1 as *const _ as *const u8,
&mut unit_field_val as *mut u8 as *mut u8,
::std::mem::size_of::<u8>(),
)
};
let mask = 1u64 as u8;
let val = (unit_field_val & mask) >> 0usize;
unsafe { ::std::mem::transmute(val as u32) }
}
#[inline]
pub fn set_derp(&mut self, val: ::std::os::raw::c_uint) {
let mask = 1u64 as u8;
let val = val as u32 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
::std::ptr::copy_nonoverlapping(
&self._bitfield_1 as *const _ as *const u8,
&mut unit_field_val as *mut u8 as *mut u8,
::std::mem::size_of::<u8>(),
)
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
::std::ptr::copy_nonoverlapping(
&unit_field_val as *const _ as *const u8,
&mut self._bitfield_1 as *mut _ as *mut u8,
::std::mem::size_of::<u8>(),
);
}
}
#[inline]
pub fn new_bitfield_1(derp: ::std::os::raw::c_uint) -> u8 {
(0 | ((derp as u32 as u8) << 0usize) & (1u64 as u8))
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct B {
pub _bitfield_1: __BindgenUnionField<u32>,
pub bindgen_union_field: u32,
}
#[test]
fn bindgen_test_layout_B() {
assert_eq!(
::std::mem::size_of::<B>(),
4usize,
concat!("Size of: ", stringify!(B))
);
assert_eq!(
::std::mem::align_of::<B>(),
4usize,
concat!("Alignment of ", stringify!(B))
);
}
impl Clone for B {
fn clone(&self) -> Self {
*self
}
}
impl B {
#[inline]
pub fn foo(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
::std::ptr::copy_nonoverlapping(
&self._bitfield_1 as *const _ as *const u8,
&mut unit_field_val as *mut u32 as *mut u8,
::std::mem::size_of::<u32>(),
)
};
let mask = 2147483647u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
unsafe { ::std::mem::transmute(val as u32) }
}
#[inline]
pub fn set_foo(&mut self, val: ::std::os::raw::c_uint) {
let mask = 2147483647u64 as u32;
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
::std::ptr::copy_nonoverlapping(
&self._bitfield_1 as *const _ as *const u8,
&mut unit_field_val as *mut u32 as *mut u8,
::std::mem::size_of::<u32>(),
)
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
::std::ptr::copy_nonoverlapping(
&unit_field_val as *const _ as *const u8,
&mut self._bitfield_1 as *mut _ as *mut u8,
::std::mem::size_of::<u32>(),
);
}
}
#[inline]
pub fn bar(&self) -> ::std::os::raw::c_uchar {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
::std::ptr::copy_nonoverlapping(
&self._bitfield_1 as *const _ as *const u8,
&mut unit_field_val as *mut u32 as *mut u8,
::std::mem::size_of::<u32>(),
)
};
let mask = 2147483648u64 as u32;
let val = (unit_field_val & mask) >> 31usize;
unsafe { ::std::mem::transmute(val as u8) }
}
#[inline]
pub fn set_bar(&mut self, val: ::std::os::raw::c_uchar) {
let mask = 2147483648u64 as u32;
let val = val as u8 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
::std::ptr::copy_nonoverlapping(
&self._bitfield_1 as *const _ as *const u8,
&mut unit_field_val as *mut u32 as *mut u8,
::std::mem::size_of::<u32>(),
)
};
unit_field_val &= !mask;
unit_field_val |= (val << 31usize) & mask;
unsafe {
::std::ptr::copy_nonoverlapping(
&unit_field_val as *const _ as *const u8,
&mut self._bitfield_1 as *mut _ as *mut u8,
::std::mem::size_of::<u32>(),
);
}
}
#[inline]
pub fn new_bitfield_1(foo: ::std::os::raw::c_uint, bar: ::std::os::raw::c_uchar) -> u32 {
((0 | ((foo as u32 as u32) << 0usize) & (2147483647u64 as u32))
| ((bar as u8 as u32) << 31usize) & (2147483648u64 as u32))
}
}
+#[repr(C)]
+#[derive(Copy)]
+pub struct HasBigBitfield {
+ pub _bitfield_1: __BindgenUnionField<[u8; 16usize]>,
+ pub bindgen_union_field: [u8; 16usize],
+}
+#[test]
+fn bindgen_test_layout_HasBigBitfield() {
+ assert_eq!(
+ ::std::mem::size_of::<HasBigBitfield>(),
+ 16usize,
+ concat!("Size of: ", stringify!(HasBigBitfield))
+ );
+}
+impl Clone for HasBigBitfield {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+impl Default for HasBigBitfield {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
+}
thread 'header_union_bitfield_1_0_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:328:0
---- header_union_dtor_1_0_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/union_dtor_1_0.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/union_dtor_1_0.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[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()
}
}
impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
}
impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
true
}
}
impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
#[repr(C)]
#[derive(Debug, Default)]
pub struct UnionWithDtor {
pub mFoo: __BindgenUnionField<::std::os::raw::c_int>,
pub mBar: __BindgenUnionField<*mut ::std::os::raw::c_void>,
pub bindgen_union_field: u64,
}
#[test]
fn bindgen_test_layout_UnionWithDtor() {
assert_eq!(
::std::mem::size_of::<UnionWithDtor>(),
8usize,
concat!("Size of: ", stringify!(UnionWithDtor))
);
assert_eq!(
::std::mem::align_of::<UnionWithDtor>(),
8usize,
concat!("Alignment of ", stringify!(UnionWithDtor))
);
assert_eq!(
unsafe { &(*(0 as *const UnionWithDtor)).mFoo as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(UnionWithDtor),
"::",
stringify!(mFoo)
)
);
assert_eq!(
unsafe { &(*(0 as *const UnionWithDtor)).mBar as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(UnionWithDtor),
"::",
stringify!(mBar)
)
);
}
extern "C" {
- #[link_name = "\u{1}_ZN13UnionWithDtorD1Ev"]
+ #[link_name = "\u{1}__ZN13UnionWithDtorD1Ev"]
pub fn UnionWithDtor_UnionWithDtor_destructor(this: *mut UnionWithDtor);
}
impl UnionWithDtor {
#[inline]
pub unsafe fn destruct(&mut self) {
UnionWithDtor_UnionWithDtor_destructor(self)
}
}
thread 'header_union_dtor_1_0_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:330:0
---- header_union_dtor_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/union_dtor.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/union_dtor.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
pub union UnionWithDtor {
pub mFoo: ::std::os::raw::c_int,
pub mBar: *mut ::std::os::raw::c_void,
_bindgen_union_align: u64,
}
#[test]
fn bindgen_test_layout_UnionWithDtor() {
assert_eq!(
::std::mem::size_of::<UnionWithDtor>(),
8usize,
concat!("Size of: ", stringify!(UnionWithDtor))
);
assert_eq!(
::std::mem::align_of::<UnionWithDtor>(),
8usize,
concat!("Alignment of ", stringify!(UnionWithDtor))
);
assert_eq!(
unsafe { &(*(0 as *const UnionWithDtor)).mFoo as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(UnionWithDtor),
"::",
stringify!(mFoo)
)
);
assert_eq!(
unsafe { &(*(0 as *const UnionWithDtor)).mBar as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(UnionWithDtor),
"::",
stringify!(mBar)
)
);
}
extern "C" {
- #[link_name = "\u{1}_ZN13UnionWithDtorD1Ev"]
+ #[link_name = "\u{1}__ZN13UnionWithDtorD1Ev"]
pub fn UnionWithDtor_UnionWithDtor_destructor(this: *mut UnionWithDtor);
}
impl Default for UnionWithDtor {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
impl UnionWithDtor {
#[inline]
pub unsafe fn destruct(&mut self) {
UnionWithDtor_UnionWithDtor_destructor(self)
}
}
thread 'header_union_dtor_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:329:0
---- header_use_core_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/use-core.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/use-core.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern crate core;
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
pub struct foo {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
pub bar: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(
::core::mem::size_of::<foo>(),
16usize,
concat!("Size of: ", stringify!(foo))
);
assert_eq!(
::core::mem::align_of::<foo>(),
8usize,
concat!("Alignment of ", stringify!(foo))
);
assert_eq!(
unsafe { &(*(0 as *const foo)).a as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a))
);
assert_eq!(
unsafe { &(*(0 as *const foo)).b as *const _ as usize },
4usize,
concat!("Alignment of field: ", stringify!(foo), "::", stringify!(b))
);
assert_eq!(
unsafe { &(*(0 as *const foo)).bar as *const _ as usize },
8usize,
concat!(
"Alignment of field: ",
stringify!(foo),
"::",
stringify!(bar)
)
);
}
impl Clone for foo {
fn clone(&self) -> Self {
*self
}
}
impl Default for foo {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Copy)]
pub union _bindgen_ty_1 {
pub bar: ::std::os::raw::c_int,
pub baz: ::std::os::raw::c_long,
_bindgen_union_align: u64,
}
#[test]
fn bindgen_test_layout__bindgen_ty_1() {
assert_eq!(
::core::mem::size_of::<_bindgen_ty_1>(),
8usize,
concat!("Size of: ", stringify!(_bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<_bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(_bindgen_ty_1))
);
assert_eq!(
unsafe { &(*(0 as *const _bindgen_ty_1)).bar as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(_bindgen_ty_1),
"::",
stringify!(bar)
)
);
assert_eq!(
unsafe { &(*(0 as *const _bindgen_ty_1)).baz as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(_bindgen_ty_1),
"::",
stringify!(baz)
)
);
}
impl Clone for _bindgen_ty_1 {
fn clone(&self) -> Self {
*self
}
}
impl Default for _bindgen_ty_1 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}bazz"]
+ #[link_name = "\u{1}_bazz"]
pub static mut bazz: _bindgen_ty_1;
}
pub type fooFunction = ::core::option::Option<unsafe extern "C" fn(bar: ::std::os::raw::c_int)>;
thread 'header_use_core_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:350:0
---- header_use_core_1_0_h stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/use-core_1_0.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/use-core_1_0.h"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern crate core;
#[repr(C)]
pub struct __BindgenUnionField<T>(::core::marker::PhantomData<T>);
impl<T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self {
__BindgenUnionField(::core::marker::PhantomData)
}
#[inline]
pub unsafe fn as_ref(&self) -> &T {
::core::mem::transmute(self)
}
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T {
::core::mem::transmute(self)
}
}
impl<T> ::core::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self {
Self::new()
}
}
impl<T> ::core::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self {
Self::new()
}
}
impl<T> ::core::marker::Copy for __BindgenUnionField<T> {}
impl<T> ::core::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
impl<T> ::core::hash::Hash for __BindgenUnionField<T> {
fn hash<H: ::core::hash::Hasher>(&self, _state: &mut H) {}
}
impl<T> ::core::cmp::PartialEq for __BindgenUnionField<T> {
fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
true
}
}
impl<T> ::core::cmp::Eq for __BindgenUnionField<T> {}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
pub struct foo {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
pub bar: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(
::core::mem::size_of::<foo>(),
16usize,
concat!("Size of: ", stringify!(foo))
);
assert_eq!(
::core::mem::align_of::<foo>(),
8usize,
concat!("Alignment of ", stringify!(foo))
);
assert_eq!(
unsafe { &(*(0 as *const foo)).a as *const _ as usize },
0usize,
concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a))
);
assert_eq!(
unsafe { &(*(0 as *const foo)).b as *const _ as usize },
4usize,
concat!("Alignment of field: ", stringify!(foo), "::", stringify!(b))
);
assert_eq!(
unsafe { &(*(0 as *const foo)).bar as *const _ as usize },
8usize,
concat!(
"Alignment of field: ",
stringify!(foo),
"::",
stringify!(bar)
)
);
}
impl Clone for foo {
fn clone(&self) -> Self {
*self
}
}
impl Default for foo {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct _bindgen_ty_1 {
pub bar: __BindgenUnionField<::std::os::raw::c_int>,
pub baz: __BindgenUnionField<::std::os::raw::c_long>,
pub bindgen_union_field: u64,
}
#[test]
fn bindgen_test_layout__bindgen_ty_1() {
assert_eq!(
::core::mem::size_of::<_bindgen_ty_1>(),
8usize,
concat!("Size of: ", stringify!(_bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<_bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(_bindgen_ty_1))
);
assert_eq!(
unsafe { &(*(0 as *const _bindgen_ty_1)).bar as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(_bindgen_ty_1),
"::",
stringify!(bar)
)
);
assert_eq!(
unsafe { &(*(0 as *const _bindgen_ty_1)).baz as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(_bindgen_ty_1),
"::",
stringify!(baz)
)
);
}
impl Clone for _bindgen_ty_1 {
fn clone(&self) -> Self {
*self
}
}
extern "C" {
- #[link_name = "\u{1}bazz"]
+ #[link_name = "\u{1}_bazz"]
pub static mut bazz: _bindgen_ty_1;
}
pub type fooFunction = ::core::option::Option<unsafe extern "C" fn(bar: ::std::os::raw::c_int)>;
thread 'header_use_core_1_0_h' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:351:0
---- header_virtual_dtor_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/virtual_dtor.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/virtual_dtor.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
pub struct nsSlots__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug)]
pub struct nsSlots {
pub vtable_: *const nsSlots__bindgen_vtable,
}
#[test]
fn bindgen_test_layout_nsSlots() {
assert_eq!(
::std::mem::size_of::<nsSlots>(),
8usize,
concat!("Size of: ", stringify!(nsSlots))
);
assert_eq!(
::std::mem::align_of::<nsSlots>(),
8usize,
concat!("Alignment of ", stringify!(nsSlots))
);
}
impl Default for nsSlots {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_ZN7nsSlotsD0Ev"]
+ #[link_name = "\u{1}__ZN7nsSlotsD0Ev"]
pub fn nsSlots_nsSlots_destructor(this: *mut nsSlots);
}
thread 'header_virtual_dtor_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:357:0
---- header_var_tracing_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/var-tracing.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/var-tracing.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Bar {
pub m_baz: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_Bar() {
assert_eq!(
::std::mem::size_of::<Bar>(),
4usize,
concat!("Size of: ", stringify!(Bar))
);
assert_eq!(
::std::mem::align_of::<Bar>(),
4usize,
concat!("Alignment of ", stringify!(Bar))
);
assert_eq!(
unsafe { &(*(0 as *const Bar)).m_baz as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Bar),
"::",
stringify!(m_baz)
)
);
}
extern "C" {
- #[link_name = "\u{1}_ZN3BarC1Ei"]
+ #[link_name = "\u{1}__ZN3BarC1Ei"]
pub fn Bar_Bar(this: *mut Bar, baz: ::std::os::raw::c_int);
}
impl Clone for Bar {
fn clone(&self) -> Self {
*self
}
}
impl Bar {
#[inline]
pub unsafe fn new(baz: ::std::os::raw::c_int) -> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
Bar_Bar(&mut __bindgen_tmp, baz);
__bindgen_tmp
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Baz {
pub _address: u8,
}
extern "C" {
- #[link_name = "\u{1}_ZN3Baz3FOOE"]
+ #[link_name = "\u{1}__ZN3Baz3FOOE"]
pub static mut Baz_FOO: [Bar; 0usize];
}
#[test]
fn bindgen_test_layout_Baz() {
assert_eq!(
::std::mem::size_of::<Baz>(),
1usize,
concat!("Size of: ", stringify!(Baz))
);
assert_eq!(
::std::mem::align_of::<Baz>(),
1usize,
concat!("Alignment of ", stringify!(Baz))
);
}
impl Clone for Baz {
fn clone(&self) -> Self {
*self
}
}
thread 'header_var_tracing_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:353:0
---- header_variadic_method_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/variadic-method.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/variadic-method.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
- #[link_name = "\u{1}_Z3fooPKcz"]
+ #[link_name = "\u{1}__Z3fooPKcz"]
pub fn foo(fmt: *const ::std::os::raw::c_char, ...);
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Bar {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Bar() {
assert_eq!(
::std::mem::size_of::<Bar>(),
1usize,
concat!("Size of: ", stringify!(Bar))
);
assert_eq!(
::std::mem::align_of::<Bar>(),
1usize,
concat!("Alignment of ", stringify!(Bar))
);
}
extern "C" {
- #[link_name = "\u{1}_ZN3Bar3fooEPKcz"]
+ #[link_name = "\u{1}__ZN3Bar3fooEPKcz"]
pub fn Bar_foo(this: *mut Bar, fmt: *const ::std::os::raw::c_char, ...);
}
impl Clone for Bar {
fn clone(&self) -> Self {
*self
}
}
thread 'header_variadic_method_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:354:0
---- header_virtual_overloaded_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/virtual_overloaded.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/virtual_overloaded.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
pub struct C__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct C {
pub vtable_: *const C__bindgen_vtable,
}
#[test]
fn bindgen_test_layout_C() {
assert_eq!(
::std::mem::size_of::<C>(),
8usize,
concat!("Size of: ", stringify!(C))
);
assert_eq!(
::std::mem::align_of::<C>(),
8usize,
concat!("Alignment of ", stringify!(C))
);
}
impl Clone for C {
fn clone(&self) -> Self {
*self
}
}
impl Default for C {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_ZN1C8do_thingEc"]
+ #[link_name = "\u{1}__ZN1C8do_thingEc"]
pub fn C_do_thing(this: *mut ::std::os::raw::c_void, arg1: ::std::os::raw::c_char);
}
extern "C" {
- #[link_name = "\u{1}_ZN1C8do_thingEi"]
+ #[link_name = "\u{1}__ZN1C8do_thingEi"]
pub fn C_do_thing1(this: *mut ::std::os::raw::c_void, arg1: ::std::os::raw::c_int);
}
thread 'header_virtual_overloaded_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:359:0
---- header_vtable_recursive_sig_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/vtable_recursive_sig.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/vtable_recursive_sig.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
pub struct Base__bindgen_vtable(::std::os::raw::c_void);
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Base {
pub vtable_: *const Base__bindgen_vtable,
}
#[test]
fn bindgen_test_layout_Base() {
assert_eq!(
::std::mem::size_of::<Base>(),
8usize,
concat!("Size of: ", stringify!(Base))
);
assert_eq!(
::std::mem::align_of::<Base>(),
8usize,
concat!("Alignment of ", stringify!(Base))
);
}
impl Clone for Base {
fn clone(&self) -> Self {
*self
}
}
impl Default for Base {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
- #[link_name = "\u{1}_ZN4Base9AsDerivedEv"]
+ #[link_name = "\u{1}__ZN4Base9AsDerivedEv"]
pub fn Base_AsDerived(this: *mut ::std::os::raw::c_void) -> *mut Derived;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Derived {
pub _base: Base,
}
#[test]
fn bindgen_test_layout_Derived() {
assert_eq!(
::std::mem::size_of::<Derived>(),
8usize,
concat!("Size of: ", stringify!(Derived))
);
assert_eq!(
::std::mem::align_of::<Derived>(),
8usize,
concat!("Alignment of ", stringify!(Derived))
);
}
impl Clone for Derived {
fn clone(&self) -> Self {
*self
}
}
impl Default for Derived {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
thread 'header_vtable_recursive_sig_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:360:0
---- header_whitelist_fix_hpp stdout ----
diff expected generated
--- expected: "/Users/pepyakin/dev/etc/rust-bindgen/tests/expectations/tests/whitelist_fix.rs"
+++ generated from: "/Users/pepyakin/dev/etc/rust-bindgen/tests/headers/whitelist_fix.hpp"
/* automatically generated by rust-bindgen */
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub enum Test {}
extern "C" {
+ #[link_name = "\u{1}_Servo_Test"]
pub fn Servo_Test(a: *mut Test);
}
thread 'header_whitelist_fix_hpp' panicked at 'Header and binding differ!', /Users/pepyakin/dev/etc/rust-bindgen/target/debug/build/bindgen-d0d75a91cf100c74/out/tests.rs:366:0
---- test_header_contents stdout ----
thread 'test_header_contents' panicked at 'assertion failed: `(left == right)`
left: `"/* automatically generated by rust-bindgen */\n\nextern \"C\" {\n pub fn foo(a: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;\n}\n"`,
right: `"/* automatically generated by rust-bindgen */\n\nextern \"C\" {\n #[link_name = \"\\u{1}_foo\"]\n pub fn foo(a: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;\n}\n"`', tests/tests.rs:324:4
---- test_multiple_header_calls_in_builder stdout ----
Generated bindings differ from expected!
/* automatically generated by rust-bindgen */
extern "C" {
- #[link_name = "\u{1}_foo"]
+ #[link_name = "\u{1}foo"]
pub static mut foo:
::std::option::Option<
unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int)
-> ::std::os::raw::c_int,
>;
}
pub type Char = ::std::os::raw::c_char;
pub type SChar = ::std::os::raw::c_schar;
pub type UChar = ::std::os::raw::c_uchar;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Test {
pub ch: ::std::os::raw::c_char,
pub u: ::std::os::raw::c_uchar,
pub d: ::std::os::raw::c_schar,
pub cch: ::std::os::raw::c_char,
pub cu: ::std::os::raw::c_uchar,
pub cd: ::std::os::raw::c_schar,
pub Cch: Char,
pub Cu: UChar,
pub Cd: SChar,
pub Ccch: Char,
pub Ccu: UChar,
pub Ccd: SChar,
}
#[test]
fn bindgen_test_layout_Test() {
assert_eq!(
::std::mem::size_of::<Test>(),
12usize,
concat!("Size of: ", stringify!(Test))
);
assert_eq!(
::std::mem::align_of::<Test>(),
1usize,
concat!("Alignment of ", stringify!(Test))
);
assert_eq!(
unsafe { &(*(0 as *const Test)).ch as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(ch)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).u as *const _ as usize },
1usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(u)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).d as *const _ as usize },
2usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(d)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).cch as *const _ as usize },
3usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(cch)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).cu as *const _ as usize },
4usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(cu)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).cd as *const _ as usize },
5usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(cd)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).Cch as *const _ as usize },
6usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(Cch)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).Cu as *const _ as usize },
7usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(Cu)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).Cd as *const _ as usize },
8usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(Cd)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).Ccch as *const _ as usize },
9usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(Ccch)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).Ccu as *const _ as usize },
10usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(Ccu)
)
);
assert_eq!(
unsafe { &(*(0 as *const Test)).Ccd as *const _ as usize },
11usize,
concat!(
"Alignment of field: ",
stringify!(Test),
"::",
stringify!(Ccd)
)
);
}
impl Clone for Test {
fn clone(&self) -> Self {
*self
}
}
thread 'test_multiple_header_calls_in_builder' panicked at 'explicit panic', tests/tests.rs:362:8
failures:
header_arg_keyword_hpp
header_auto_hpp
header_bitfield_large_overflow_hpp
header_bitfield_method_same_name_hpp
header_blocks_h
header_canonical_path_without_namespacing_hpp
header_class_1_0_hpp
header_class_hpp
header_class_nested_hpp
header_class_static_hpp
header_class_with_typedef_hpp
header_complex_global_h
header_const_array_fn_arg_h
header_const_ptr_hpp
header_const_resolved_ty_h
header_constify_module_enums_basic_h
header_constify_module_enums_types_hpp
header_constructor_tp_hpp
header_constructors_hpp
header_decl_extern_int_twice_h
header_decl_ptr_to_array_h
header_default_template_parameter_hpp
header_derive_bitfield_method_same_name_hpp
header_elaborated_hpp
header_enum_and_vtable_mangling_hpp
header_forward_declared_complex_types_1_0_hpp
header_forward_declared_complex_types_hpp
header_func_ptr_h
header_func_with_array_arg_h
header_func_with_func_ptr_arg_h
header_gen_constructors_hpp
header_gen_destructors_hpp
header_generate_inline_hpp
header_inner_const_hpp
header_issue_410_hpp
header_issue_447_hpp
header_issue_574_assertion_failure_in_codegen_hpp
header_issue_584_stylo_template_analysis_panic_hpp
header_issue_654_struct_fn_collision_h
header_issue_801_opaque_sloppiness_hpp
header_issue_807_opaque_types_methods_being_generated_hpp
header_issue_833_1_hpp
header_issue_833_hpp
header_issue_848_replacement_system_include_hpp
header_issue_888_enum_var_decl_jump_hpp
header_keywords_h
header_macro_expr_uncommon_token_h
header_method_mangling_hpp
header_namespace_hpp
header_nested_vtable_hpp
header_objc_class_h
header_objc_interface_type_h
header_objc_sel_and_id_h
header_opaque_tracing_hpp
header_overloading_hpp
header_partial_specialization_and_inheritance_hpp
header_public_dtor_hpp
header_redeclaration_hpp
header_ref_argument_array_hpp
header_resolved_type_def_function_h
header_template_hpp
header_type_referenced_by_whitelisted_function_h
header_typedefd_array_as_function_arg_h
header_union_bitfield_1_0_h
header_union_dtor_1_0_hpp
header_union_dtor_hpp
header_use_core_1_0_h
header_use_core_h
header_var_tracing_hpp
header_variadic_method_hpp
header_virtual_dtor_hpp
header_virtual_overloaded_hpp
header_vtable_recursive_sig_hpp
header_whitelist_fix_hpp
test_header_contents
test_multiple_header_calls_in_builder
test result: FAILED. 296 passed; 76 failed; 0 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--test tests'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment