From 8592f3677b7d9624ac6bd64df46a962c92b4561f Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Wed, 1 Nov 2017 15:57:50 -0700 Subject: [PATCH 1/2] Avoid divide-by-zero when checking if a field will merge with bitfields --- src/codegen/struct_layout.rs | 7 ++- .../tests/divide-by-zero-in-struct-layout.rs | 45 +++++++++++++++++++ .../headers/divide-by-zero-in-struct-layout.h | 22 +++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 tests/expectations/tests/divide-by-zero-in-struct-layout.rs create mode 100644 tests/headers/divide-by-zero-in-struct-layout.h diff --git a/src/codegen/struct_layout.rs b/src/codegen/struct_layout.rs index c3c781cb0b..ca46947d1d 100644 --- a/src/codegen/struct_layout.rs +++ b/src/codegen/struct_layout.rs @@ -335,9 +335,12 @@ impl<'a> StructLayoutTracker<'a> { new_field_layout ); + // Avoid divide-by-zero errors if align is 0. + let align = cmp::max(1, layout.align); + if self.last_field_was_bitfield && - new_field_layout.align <= layout.size % layout.align && - new_field_layout.size <= layout.size % layout.align + new_field_layout.align <= layout.size % align && + new_field_layout.size <= layout.size % align { // The new field will be coalesced into some of the remaining bits. // diff --git a/tests/expectations/tests/divide-by-zero-in-struct-layout.rs b/tests/expectations/tests/divide-by-zero-in-struct-layout.rs new file mode 100644 index 0000000000..9fb429af12 --- /dev/null +++ b/tests/expectations/tests/divide-by-zero-in-struct-layout.rs @@ -0,0 +1,45 @@ +/* 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 WithBitfield { + pub _bitfield_1: [u8; 0usize], + pub __bindgen_padding_0: u32, + pub a: ::std::os::raw::c_uint, +} +impl WithBitfield { + #[inline] + pub fn new_bitfield_1() -> u8 { + 0 + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +pub struct WithBitfieldAndAttrPacked { + pub _bitfield_1: [u8; 0usize], + pub a: ::std::os::raw::c_uint, + pub __bindgen_padding_0: u8, +} +impl WithBitfieldAndAttrPacked { + #[inline] + pub fn new_bitfield_1() -> u8 { + 0 + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +pub struct WithBitfieldAndPacked { + pub _bitfield_1: [u8; 0usize], + pub a: ::std::os::raw::c_uint, + pub __bindgen_padding_0: u8, +} +impl WithBitfieldAndPacked { + #[inline] + pub fn new_bitfield_1() -> u8 { + 0 + } +} diff --git a/tests/headers/divide-by-zero-in-struct-layout.h b/tests/headers/divide-by-zero-in-struct-layout.h new file mode 100644 index 0000000000..470250d3b7 --- /dev/null +++ b/tests/headers/divide-by-zero-in-struct-layout.h @@ -0,0 +1,22 @@ +// bindgen-flags: --no-layout-tests +// +// Unfortunately, we aren't translating the second and third structs correctly +// yet. But we definitely shouldn't divide-by-zero when we see it... +// +// Once we fix #981 we should remove the `--no-layout-tests`. + +struct WithBitfield { + unsigned : 7; + unsigned a; +}; + +struct WithBitfieldAndAttrPacked { + unsigned : 7; + unsigned a; +} __attribute__((packed)); + +#pragma pack(1) +struct WithBitfieldAndPacked { + unsigned : 7; + unsigned a; +}; From 460aaa06b271685ad56732ebfbc45054223b990d Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Wed, 1 Nov 2017 15:47:52 -0700 Subject: [PATCH 2/2] "Alignment of field" -> "Offset of field" It isn't checking alignment at all; it's checking offsets. --- src/codegen/mod.rs | 10 +- tests/expectations/tests/16-byte-alignment.rs | 24 +-- .../tests/16-byte-alignment_1_0.rs | 24 +-- tests/expectations/tests/accessors.rs | 28 +-- tests/expectations/tests/annotation_hide.rs | 2 +- tests/expectations/tests/anon_enum.rs | 14 +- .../tests/anon_struct_in_union.rs | 6 +- .../tests/anon_struct_in_union_1_0.rs | 6 +- .../tests/array-of-zero-sized-types.rs | 2 +- tests/expectations/tests/bitfield_align.rs | 10 +- .../tests/blacklist-and-impl-debug.rs | 2 +- tests/expectations/tests/char.rs | 79 ++------- tests/expectations/tests/class.rs | 32 ++-- tests/expectations/tests/class_1_0.rs | 32 ++-- tests/expectations/tests/class_nested.rs | 18 +- tests/expectations/tests/class_no_members.rs | 2 +- tests/expectations/tests/class_use_as.rs | 4 +- tests/expectations/tests/class_with_dtor.rs | 2 +- .../tests/class_with_inner_struct.rs | 38 ++-- .../tests/class_with_inner_struct_1_0.rs | 38 ++-- .../expectations/tests/class_with_typedef.rs | 12 +- tests/expectations/tests/comment-indent.rs | 2 +- tests/expectations/tests/complex.rs | 8 +- .../expectations/tests/constify-all-enums.rs | 2 +- .../tests/constify-module-enums-basic.rs | 2 +- .../tests/constify-module-enums-namespace.rs | 2 +- .../constify-module-enums-shadow-name.rs | 2 +- .../constify-module-enums-simple-alias.rs | 36 +--- ...onstify-module-enums-simple-nonamespace.rs | 14 +- .../tests/constify-module-enums-types.rs | 29 ++-- .../tests/contains-vs-inherits-zero-sized.rs | 6 +- .../tests/convert-cpp-comment-to-rust.rs | 6 +- tests/expectations/tests/convert-floats.rs | 27 +-- .../tests/derive-bitfield-method-same-name.rs | 2 +- tests/expectations/tests/derive-clone.rs | 2 +- tests/expectations/tests/derive-clone_1_0.rs | 2 +- .../tests/derive-debug-bitfield.rs | 2 +- .../tests/derive-debug-function-pointer.rs | 4 +- .../tests/derive-debug-mangle-name.rs | 8 +- ...ive-debug-opaque-template-instantiation.rs | 2 +- .../expectations/tests/derive-debug-opaque.rs | 2 +- .../tests/derive-default-and-blacklist.rs | 2 +- tests/expectations/tests/derive-fn-ptr.rs | 4 +- .../tests/derive-hash-and-blacklist.rs | 2 +- .../tests/derive-hash-blacklisting.rs | 4 +- ...rive-hash-struct-with-anon-struct-float.rs | 11 +- .../derive-hash-struct-with-float-array.rs | 7 +- ...erive-hash-struct-with-incomplete-array.rs | 9 +- .../tests/derive-hash-struct-with-pointer.rs | 8 +- .../tests/derive-hash-template-inst-float.rs | 9 +- .../tests/derive-partialeq-and-blacklist.rs | 2 +- .../tests/derive-partialeq-base.rs | 2 +- .../tests/derive-partialeq-bitfield.rs | 2 +- .../tests/derive-partialeq-core.rs | 2 +- .../tests/derive-partialeq-pointer.rs | 4 +- .../tests/derive-partialeq-union.rs | 4 +- .../tests/derive-partialeq-union_1_0.rs | 4 +- .../tests/divide-by-zero-in-struct-layout.rs | 3 +- .../expectations/tests/do-not-derive-copy.rs | 2 +- tests/expectations/tests/doggo-or-null.rs | 7 +- .../duplicated-namespaces-definitions.rs | 21 +-- .../tests/enum_and_vtable_mangling.rs | 2 +- .../tests/forward-declaration-autoptr.rs | 2 +- .../tests/forward_declared_complex_types.rs | 2 +- .../forward_declared_complex_types_1_0.rs | 2 +- .../tests/forward_declared_struct.rs | 4 +- .../expectations/tests/func_ptr_in_struct.rs | 7 +- .../expectations/tests/gen-destructors-neg.rs | 7 +- tests/expectations/tests/gen-destructors.rs | 7 +- tests/expectations/tests/inline_namespace.rs | 7 +- .../tests/inline_namespace_conservative.rs | 7 +- tests/expectations/tests/inner_const.rs | 7 +- .../expectations/tests/inner_template_self.rs | 2 +- .../tests/issue-1118-using-forward-decl.rs | 4 +- tests/expectations/tests/issue-372.rs | 10 +- tests/expectations/tests/issue-537.rs | 120 +++++++++++++ .../tests/issue-573-layout-test-failures.rs | 2 +- .../issue-574-assertion-failure-in-codegen.rs | 2 +- ...issue-584-stylo-template-analysis-panic.rs | 2 +- .../tests/issue-639-typedef-anon-field.rs | 11 +- .../tests/issue-643-inner-struct.rs | 4 +- .../issue-648-derive-debug-with-padding.rs | 6 +- tests/expectations/tests/issue-674-1.rs | 2 +- tests/expectations/tests/issue-674-2.rs | 4 +- tests/expectations/tests/issue-674-3.rs | 4 +- .../tests/issue-801-opaque-sloppiness.rs | 2 +- ...07-opaque-types-methods-being-generated.rs | 2 +- .../issue-944-derive-copy-and-blacklisting.rs | 2 +- .../expectations/tests/jsval_layout_opaque.rs | 24 +-- .../tests/jsval_layout_opaque_1_0.rs | 24 +-- tests/expectations/tests/layout_align.rs | 2 +- tests/expectations/tests/layout_arp.rs | 22 +-- tests/expectations/tests/layout_array.rs | 30 ++-- .../tests/layout_array_too_long.rs | 30 ++-- .../tests/layout_cmdline_token.rs | 18 +- tests/expectations/tests/layout_eth_conf.rs | 164 +++++++++--------- .../expectations/tests/layout_eth_conf_1_0.rs | 164 +++++++++--------- tests/expectations/tests/layout_kni_mbuf.rs | 28 +-- .../tests/layout_large_align_field.rs | 68 ++++---- tests/expectations/tests/layout_mbuf.rs | 76 ++++---- tests/expectations/tests/layout_mbuf_1_0.rs | 76 ++++---- .../tests/libclang-3.8/call-conv-field.rs | 4 +- .../type_alias_template_specialized.rs | 2 +- .../tests/libclang-3.9/call-conv-field.rs | 4 +- .../type_alias_template_specialized.rs | 2 +- .../tests/libclang-4/call-conv-field.rs | 4 +- .../type_alias_template_specialized.rs | 2 +- tests/expectations/tests/msvc-no-usr.rs | 2 +- tests/expectations/tests/mutable.rs | 8 +- tests/expectations/tests/namespace.rs | 2 +- tests/expectations/tests/nested.rs | 11 +- .../tests/nested_within_namespace.rs | 16 +- tests/expectations/tests/no-comments.rs | 2 +- tests/expectations/tests/no-derive-debug.rs | 14 +- tests/expectations/tests/no-derive-default.rs | 14 +- .../expectations/tests/no-hash-whitelisted.rs | 7 +- .../tests/no-partialeq-whitelisted.rs | 2 +- .../tests/no-recursive-whitelisting.rs | 7 +- tests/expectations/tests/no-std.rs | 11 +- .../expectations/tests/no_copy_whitelisted.rs | 7 +- tests/expectations/tests/non-type-params.rs | 6 +- .../expectations/tests/objc_interface_type.rs | 2 +- .../tests/opaque-template-inst-member-2.rs | 6 +- .../tests/opaque-template-inst-member.rs | 6 +- ...paque-template-instantiation-namespaced.rs | 8 +- .../tests/opaque-template-instantiation.rs | 4 +- tests/expectations/tests/opaque_in_struct.rs | 2 +- tests/expectations/tests/opaque_pointer.rs | 6 +- tests/expectations/tests/private.rs | 12 +- .../tests/reparented_replacement.rs | 7 +- tests/expectations/tests/replace_use.rs | 7 +- ...ame_struct_name_in_different_namespaces.rs | 4 +- .../tests/sentry-defined-multiple-times.rs | 12 +- tests/expectations/tests/size_t_template.rs | 2 +- ...ruct_containing_forward_declared_struct.rs | 14 +- tests/expectations/tests/struct_typedef.rs | 4 +- tests/expectations/tests/struct_typedef_ns.rs | 4 +- .../tests/struct_with_anon_struct.rs | 11 +- .../tests/struct_with_anon_struct_array.rs | 22 +-- .../tests/struct_with_anon_struct_pointer.rs | 11 +- .../tests/struct_with_anon_union.rs | 11 +- .../tests/struct_with_anon_union_1_0.rs | 11 +- .../tests/struct_with_anon_unnamed_struct.rs | 4 +- .../tests/struct_with_anon_unnamed_union.rs | 4 +- .../struct_with_anon_unnamed_union_1_0.rs | 4 +- .../tests/struct_with_bitfields.rs | 2 +- .../tests/struct_with_derive_debug.rs | 8 +- .../tests/struct_with_large_array.rs | 2 +- .../expectations/tests/struct_with_nesting.rs | 16 +- .../tests/struct_with_nesting_1_0.rs | 16 +- .../expectations/tests/struct_with_packing.rs | 4 +- .../expectations/tests/struct_with_struct.rs | 11 +- tests/expectations/tests/template.rs | 41 ++--- .../test_multiple_header_calls_in_builder.rs | 24 +-- ...type-referenced-by-whitelisted-function.rs | 2 +- tests/expectations/tests/typeref.rs | 11 +- tests/expectations/tests/typeref_1_0.rs | 11 +- tests/expectations/tests/underscore.rs | 7 +- tests/expectations/tests/union-in-ns.rs | 7 +- tests/expectations/tests/union-in-ns_1_0.rs | 7 +- tests/expectations/tests/union_dtor.rs | 4 +- tests/expectations/tests/union_dtor_1_0.rs | 4 +- tests/expectations/tests/union_fields.rs | 6 +- tests/expectations/tests/union_fields_1_0.rs | 6 +- .../tests/union_with_anon_struct.rs | 11 +- .../tests/union_with_anon_struct_1_0.rs | 11 +- .../tests/union_with_anon_struct_bitfield.rs | 2 +- .../union_with_anon_struct_bitfield_1_0.rs | 2 +- .../tests/union_with_anon_union.rs | 11 +- .../tests/union_with_anon_union_1_0.rs | 11 +- .../tests/union_with_anon_unnamed_struct.rs | 10 +- .../union_with_anon_unnamed_struct_1_0.rs | 10 +- .../tests/union_with_anon_unnamed_union.rs | 6 +- .../union_with_anon_unnamed_union_1_0.rs | 6 +- .../tests/union_with_big_member.rs | 12 +- .../tests/union_with_big_member_1_0.rs | 12 +- .../expectations/tests/union_with_nesting.rs | 10 +- .../tests/union_with_nesting_1_0.rs | 10 +- tests/expectations/tests/unknown_attr.rs | 4 +- tests/expectations/tests/use-core.rs | 15 +- tests/expectations/tests/use-core_1_0.rs | 15 +- tests/expectations/tests/var-tracing.rs | 2 +- tests/expectations/tests/vector.rs | 2 +- .../expectations/tests/virtual_inheritance.rs | 6 +- tests/expectations/tests/weird_bitfields.rs | 24 +-- .../tests/whitelist-namespaces.rs | 2 +- .../whitelisted-item-references-no-hash.rs | 2 +- ...hitelisted-item-references-no-partialeq.rs | 2 +- .../whitelisted_item_references_no_copy.rs | 2 +- tests/expectations/tests/zero-sized-array.rs | 4 +- 190 files changed, 1022 insertions(+), 1289 deletions(-) create mode 100644 tests/expectations/tests/issue-537.rs diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index d36decb0a0..2cbde73262 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -1787,9 +1787,13 @@ impl CodeGenerator for CompInfo { let field_name = ctx.rust_ident(name); Some(quote! { - assert_eq!(unsafe { &(*(0 as *const #canonical_ident)).#field_name as *const _ as usize }, - #field_offset, - concat!("Alignment of field: ", stringify!(#canonical_ident), "::", stringify!(#field_name))); + assert_eq!( + unsafe { + &(*(0 as *const #canonical_ident)).#field_name as *const _ as usize + }, + #field_offset, + concat!("Offset of field: ", stringify!(#canonical_ident), "::", stringify!(#field_name)) + ); }) }) }) diff --git a/tests/expectations/tests/16-byte-alignment.rs b/tests/expectations/tests/16-byte-alignment.rs index 57bc753da3..653366ec71 100644 --- a/tests/expectations/tests/16-byte-alignment.rs +++ b/tests/expectations/tests/16-byte-alignment.rs @@ -48,7 +48,7 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1), "::", stringify!(dport) @@ -60,7 +60,7 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1() { }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1), "::", stringify!(sport) @@ -83,7 +83,7 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1() { unsafe { &(*(0 as *const rte_ipv4_tuple__bindgen_ty_1)).sctp_tag as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv4_tuple__bindgen_ty_1), "::", stringify!(sctp_tag) @@ -111,7 +111,7 @@ fn bindgen_test_layout_rte_ipv4_tuple() { unsafe { &(*(0 as *const rte_ipv4_tuple)).src_addr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv4_tuple), "::", stringify!(src_addr) @@ -121,7 +121,7 @@ fn bindgen_test_layout_rte_ipv4_tuple() { unsafe { &(*(0 as *const rte_ipv4_tuple)).dst_addr as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv4_tuple), "::", stringify!(dst_addr) @@ -177,7 +177,7 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1), "::", stringify!(dport) @@ -189,7 +189,7 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1() { }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1), "::", stringify!(sport) @@ -212,7 +212,7 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1() { unsafe { &(*(0 as *const rte_ipv6_tuple__bindgen_ty_1)).sctp_tag as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv6_tuple__bindgen_ty_1), "::", stringify!(sctp_tag) @@ -240,7 +240,7 @@ fn bindgen_test_layout_rte_ipv6_tuple() { unsafe { &(*(0 as *const rte_ipv6_tuple)).src_addr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv6_tuple), "::", stringify!(src_addr) @@ -250,7 +250,7 @@ fn bindgen_test_layout_rte_ipv6_tuple() { unsafe { &(*(0 as *const rte_ipv6_tuple)).dst_addr as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv6_tuple), "::", stringify!(dst_addr) @@ -280,7 +280,7 @@ fn bindgen_test_layout_rte_thash_tuple() { unsafe { &(*(0 as *const rte_thash_tuple)).v4 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_thash_tuple), "::", stringify!(v4) @@ -290,7 +290,7 @@ fn bindgen_test_layout_rte_thash_tuple() { unsafe { &(*(0 as *const rte_thash_tuple)).v6 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_thash_tuple), "::", stringify!(v6) diff --git a/tests/expectations/tests/16-byte-alignment_1_0.rs b/tests/expectations/tests/16-byte-alignment_1_0.rs index 712bc51971..32572ddec2 100644 --- a/tests/expectations/tests/16-byte-alignment_1_0.rs +++ b/tests/expectations/tests/16-byte-alignment_1_0.rs @@ -91,7 +91,7 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1), "::", stringify!(dport) @@ -103,7 +103,7 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1() { }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1), "::", stringify!(sport) @@ -131,7 +131,7 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1() { unsafe { &(*(0 as *const rte_ipv4_tuple__bindgen_ty_1)).sctp_tag as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv4_tuple__bindgen_ty_1), "::", stringify!(sctp_tag) @@ -159,7 +159,7 @@ fn bindgen_test_layout_rte_ipv4_tuple() { unsafe { &(*(0 as *const rte_ipv4_tuple)).src_addr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv4_tuple), "::", stringify!(src_addr) @@ -169,7 +169,7 @@ fn bindgen_test_layout_rte_ipv4_tuple() { unsafe { &(*(0 as *const rte_ipv4_tuple)).dst_addr as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv4_tuple), "::", stringify!(dst_addr) @@ -225,7 +225,7 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1), "::", stringify!(dport) @@ -237,7 +237,7 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1() { }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1), "::", stringify!(sport) @@ -265,7 +265,7 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1() { unsafe { &(*(0 as *const rte_ipv6_tuple__bindgen_ty_1)).sctp_tag as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv6_tuple__bindgen_ty_1), "::", stringify!(sctp_tag) @@ -293,7 +293,7 @@ fn bindgen_test_layout_rte_ipv6_tuple() { unsafe { &(*(0 as *const rte_ipv6_tuple)).src_addr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv6_tuple), "::", stringify!(src_addr) @@ -303,7 +303,7 @@ fn bindgen_test_layout_rte_ipv6_tuple() { unsafe { &(*(0 as *const rte_ipv6_tuple)).dst_addr as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ipv6_tuple), "::", stringify!(dst_addr) @@ -333,7 +333,7 @@ fn bindgen_test_layout_rte_thash_tuple() { unsafe { &(*(0 as *const rte_thash_tuple)).v4 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_thash_tuple), "::", stringify!(v4) @@ -343,7 +343,7 @@ fn bindgen_test_layout_rte_thash_tuple() { unsafe { &(*(0 as *const rte_thash_tuple)).v6 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_thash_tuple), "::", stringify!(v6) diff --git a/tests/expectations/tests/accessors.rs b/tests/expectations/tests/accessors.rs index ac2fb74719..a9c2888a2f 100644 --- a/tests/expectations/tests/accessors.rs +++ b/tests/expectations/tests/accessors.rs @@ -31,7 +31,7 @@ fn bindgen_test_layout_SomeAccessors() { unsafe { &(*(0 as *const SomeAccessors)).mNoAccessor as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(SomeAccessors), "::", stringify!(mNoAccessor) @@ -41,7 +41,7 @@ fn bindgen_test_layout_SomeAccessors() { unsafe { &(*(0 as *const SomeAccessors)).mBothAccessors as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(SomeAccessors), "::", stringify!(mBothAccessors) @@ -51,7 +51,7 @@ fn bindgen_test_layout_SomeAccessors() { unsafe { &(*(0 as *const SomeAccessors)).mUnsafeAccessors as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(SomeAccessors), "::", stringify!(mUnsafeAccessors) @@ -61,7 +61,7 @@ fn bindgen_test_layout_SomeAccessors() { unsafe { &(*(0 as *const SomeAccessors)).mImmutableAccessor as *const _ as usize }, 12usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(SomeAccessors), "::", stringify!(mImmutableAccessor) @@ -113,7 +113,7 @@ fn bindgen_test_layout_AllAccessors() { unsafe { &(*(0 as *const AllAccessors)).mBothAccessors as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(AllAccessors), "::", stringify!(mBothAccessors) @@ -123,7 +123,7 @@ fn bindgen_test_layout_AllAccessors() { unsafe { &(*(0 as *const AllAccessors)).mAlsoBothAccessors as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(AllAccessors), "::", stringify!(mAlsoBothAccessors) @@ -171,7 +171,7 @@ fn bindgen_test_layout_AllUnsafeAccessors() { unsafe { &(*(0 as *const AllUnsafeAccessors)).mBothAccessors as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(AllUnsafeAccessors), "::", stringify!(mBothAccessors) @@ -181,7 +181,7 @@ fn bindgen_test_layout_AllUnsafeAccessors() { unsafe { &(*(0 as *const AllUnsafeAccessors)).mAlsoBothAccessors as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(AllUnsafeAccessors), "::", stringify!(mAlsoBothAccessors) @@ -234,7 +234,7 @@ fn bindgen_test_layout_ContradictAccessors() { unsafe { &(*(0 as *const ContradictAccessors)).mBothAccessors as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContradictAccessors), "::", stringify!(mBothAccessors) @@ -244,7 +244,7 @@ fn bindgen_test_layout_ContradictAccessors() { unsafe { &(*(0 as *const ContradictAccessors)).mNoAccessors as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContradictAccessors), "::", stringify!(mNoAccessors) @@ -254,7 +254,7 @@ fn bindgen_test_layout_ContradictAccessors() { unsafe { &(*(0 as *const ContradictAccessors)).mUnsafeAccessors as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContradictAccessors), "::", stringify!(mUnsafeAccessors) @@ -264,7 +264,7 @@ fn bindgen_test_layout_ContradictAccessors() { unsafe { &(*(0 as *const ContradictAccessors)).mImmutableAccessor as *const _ as usize }, 12usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContradictAccessors), "::", stringify!(mImmutableAccessor) @@ -315,7 +315,7 @@ fn bindgen_test_layout_Replaced() { unsafe { &(*(0 as *const Replaced)).mAccessor as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Replaced), "::", stringify!(mAccessor) @@ -354,7 +354,7 @@ fn bindgen_test_layout_Wrapper() { unsafe { &(*(0 as *const Wrapper)).mReplaced as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Wrapper), "::", stringify!(mReplaced) diff --git a/tests/expectations/tests/annotation_hide.rs b/tests/expectations/tests/annotation_hide.rs index 7f68d115cb..de38b1eea8 100644 --- a/tests/expectations/tests/annotation_hide.rs +++ b/tests/expectations/tests/annotation_hide.rs @@ -45,7 +45,7 @@ fn bindgen_test_layout_NotAnnotated() { unsafe { &(*(0 as *const NotAnnotated)).f as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(NotAnnotated), "::", stringify!(f) diff --git a/tests/expectations/tests/anon_enum.rs b/tests/expectations/tests/anon_enum.rs index 3dfd5ad34f..505c692e46 100644 --- a/tests/expectations/tests/anon_enum.rs +++ b/tests/expectations/tests/anon_enum.rs @@ -31,22 +31,12 @@ fn bindgen_test_layout_Test() { assert_eq!( unsafe { &(*(0 as *const Test)).foo as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Test), - "::", - stringify!(foo) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(foo)) ); assert_eq!( unsafe { &(*(0 as *const Test)).bar as *const _ as usize }, 4usize, - concat!( - "Alignment of field: ", - stringify!(Test), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(bar)) ); } #[repr(u32)] diff --git a/tests/expectations/tests/anon_struct_in_union.rs b/tests/expectations/tests/anon_struct_in_union.rs index 4a5054f609..4123fb21e3 100644 --- a/tests/expectations/tests/anon_struct_in_union.rs +++ b/tests/expectations/tests/anon_struct_in_union.rs @@ -36,7 +36,7 @@ fn bindgen_test_layout_s__bindgen_ty_1_inner() { unsafe { &(*(0 as *const s__bindgen_ty_1_inner)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(s__bindgen_ty_1_inner), "::", stringify!(b) @@ -59,7 +59,7 @@ fn bindgen_test_layout_s__bindgen_ty_1() { unsafe { &(*(0 as *const s__bindgen_ty_1)).field as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(s__bindgen_ty_1), "::", stringify!(field) @@ -86,7 +86,7 @@ fn bindgen_test_layout_s() { assert_eq!( unsafe { &(*(0 as *const s)).u as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(s), "::", stringify!(u)) + concat!("Offset of field: ", stringify!(s), "::", stringify!(u)) ); } impl Default for s { diff --git a/tests/expectations/tests/anon_struct_in_union_1_0.rs b/tests/expectations/tests/anon_struct_in_union_1_0.rs index 8e2e6bea76..60904743cb 100644 --- a/tests/expectations/tests/anon_struct_in_union_1_0.rs +++ b/tests/expectations/tests/anon_struct_in_union_1_0.rs @@ -79,7 +79,7 @@ fn bindgen_test_layout_s__bindgen_ty_1_inner() { unsafe { &(*(0 as *const s__bindgen_ty_1_inner)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(s__bindgen_ty_1_inner), "::", stringify!(b) @@ -107,7 +107,7 @@ fn bindgen_test_layout_s__bindgen_ty_1() { unsafe { &(*(0 as *const s__bindgen_ty_1)).field as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(s__bindgen_ty_1), "::", stringify!(field) @@ -134,7 +134,7 @@ fn bindgen_test_layout_s() { assert_eq!( unsafe { &(*(0 as *const s)).u as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(s), "::", stringify!(u)) + concat!("Offset of field: ", stringify!(s), "::", stringify!(u)) ); } impl Clone for s { diff --git a/tests/expectations/tests/array-of-zero-sized-types.rs b/tests/expectations/tests/array-of-zero-sized-types.rs index 92fbeadfc5..304733da31 100644 --- a/tests/expectations/tests/array-of-zero-sized-types.rs +++ b/tests/expectations/tests/array-of-zero-sized-types.rs @@ -47,7 +47,7 @@ fn bindgen_test_layout_HasArrayOfEmpty() { unsafe { &(*(0 as *const HasArrayOfEmpty)).empties as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(HasArrayOfEmpty), "::", stringify!(empties) diff --git a/tests/expectations/tests/bitfield_align.rs b/tests/expectations/tests/bitfield_align.rs index aa718a741d..7e35f9960d 100644 --- a/tests/expectations/tests/bitfield_align.rs +++ b/tests/expectations/tests/bitfield_align.rs @@ -27,12 +27,12 @@ fn bindgen_test_layout_A() { assert_eq!( unsafe { &(*(0 as *const A)).x as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(A), "::", stringify!(x)) + concat!("Offset of field: ", stringify!(A), "::", stringify!(x)) ); assert_eq!( unsafe { &(*(0 as *const A)).y as *const _ as usize }, 3usize, - concat!("Alignment of field: ", stringify!(A), "::", stringify!(y)) + concat!("Offset of field: ", stringify!(A), "::", stringify!(y)) ); } impl A { @@ -541,12 +541,12 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).x as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(x)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(x)) ); assert_eq!( unsafe { &(*(0 as *const C)).baz as *const _ as usize }, 4usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(baz)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(baz)) ); } impl C { @@ -1044,7 +1044,7 @@ fn bindgen_test_layout_Date3() { unsafe { &(*(0 as *const Date3)).byte as *const _ as usize }, 3usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Date3), "::", stringify!(byte) diff --git a/tests/expectations/tests/blacklist-and-impl-debug.rs b/tests/expectations/tests/blacklist-and-impl-debug.rs index 3cba2b29bf..9cfab7c402 100644 --- a/tests/expectations/tests/blacklist-and-impl-debug.rs +++ b/tests/expectations/tests/blacklist-and-impl-debug.rs @@ -27,7 +27,7 @@ fn bindgen_test_layout_ShouldManuallyImplDebug() { unsafe { &(*(0 as *const ShouldManuallyImplDebug)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldManuallyImplDebug), "::", stringify!(a) diff --git a/tests/expectations/tests/char.rs b/tests/expectations/tests/char.rs index 9f7834ae9b..f92331bb0e 100644 --- a/tests/expectations/tests/char.rs +++ b/tests/expectations/tests/char.rs @@ -38,98 +38,53 @@ fn bindgen_test_layout_Test() { assert_eq!( unsafe { &(*(0 as *const Test)).ch as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Test), - "::", - stringify!(ch) - ) + concat!("Offset 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) - ) + concat!("Offset 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) - ) + concat!("Offset 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) - ) + concat!("Offset 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) - ) + concat!("Offset 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) - ) + concat!("Offset 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) - ) + concat!("Offset 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) - ) + concat!("Offset 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) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(Cd)) ); assert_eq!( unsafe { &(*(0 as *const Test)).Ccch as *const _ as usize }, 9usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(Ccch) @@ -138,21 +93,11 @@ fn bindgen_test_layout_Test() { assert_eq!( unsafe { &(*(0 as *const Test)).Ccu as *const _ as usize }, 10usize, - concat!( - "Alignment of field: ", - stringify!(Test), - "::", - stringify!(Ccu) - ) + concat!("Offset 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) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(Ccd)) ); } diff --git a/tests/expectations/tests/class.rs b/tests/expectations/tests/class.rs index 784a42d32f..847a10c49d 100644 --- a/tests/expectations/tests/class.rs +++ b/tests/expectations/tests/class.rs @@ -62,13 +62,13 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(a)) ); assert_eq!( unsafe { &(*(0 as *const C)).big_array as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(big_array) @@ -102,7 +102,7 @@ fn bindgen_test_layout_C_with_zero_length_array() { unsafe { &(*(0 as *const C_with_zero_length_array)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_with_zero_length_array), "::", stringify!(a) @@ -112,7 +112,7 @@ fn bindgen_test_layout_C_with_zero_length_array() { unsafe { &(*(0 as *const C_with_zero_length_array)).big_array as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_with_zero_length_array), "::", stringify!(big_array) @@ -124,7 +124,7 @@ fn bindgen_test_layout_C_with_zero_length_array() { }, 37usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_with_zero_length_array), "::", stringify!(zero_length_array) @@ -158,7 +158,7 @@ fn bindgen_test_layout_C_with_zero_length_array_2() { unsafe { &(*(0 as *const C_with_zero_length_array_2)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_with_zero_length_array_2), "::", stringify!(a) @@ -170,7 +170,7 @@ fn bindgen_test_layout_C_with_zero_length_array_2() { }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_with_zero_length_array_2), "::", stringify!(zero_length_array) @@ -298,7 +298,7 @@ fn bindgen_test_layout_WithDtor() { unsafe { &(*(0 as *const WithDtor)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithDtor), "::", stringify!(b) @@ -350,22 +350,12 @@ fn bindgen_test_layout_Union() { assert_eq!( unsafe { &(*(0 as *const Union)).d as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Union), - "::", - stringify!(d) - ) + concat!("Offset 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) - ) + concat!("Offset of field: ", stringify!(Union), "::", stringify!(i)) ); } impl Default for Union { @@ -394,7 +384,7 @@ fn bindgen_test_layout_WithUnion() { unsafe { &(*(0 as *const WithUnion)).data as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithUnion), "::", stringify!(data) diff --git a/tests/expectations/tests/class_1_0.rs b/tests/expectations/tests/class_1_0.rs index c54edcdbf4..c20866dfe5 100644 --- a/tests/expectations/tests/class_1_0.rs +++ b/tests/expectations/tests/class_1_0.rs @@ -105,13 +105,13 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(a)) ); assert_eq!( unsafe { &(*(0 as *const C)).big_array as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(big_array) @@ -155,7 +155,7 @@ fn bindgen_test_layout_C_with_zero_length_array() { unsafe { &(*(0 as *const C_with_zero_length_array)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_with_zero_length_array), "::", stringify!(a) @@ -165,7 +165,7 @@ fn bindgen_test_layout_C_with_zero_length_array() { unsafe { &(*(0 as *const C_with_zero_length_array)).big_array as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_with_zero_length_array), "::", stringify!(big_array) @@ -177,7 +177,7 @@ fn bindgen_test_layout_C_with_zero_length_array() { }, 37usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_with_zero_length_array), "::", stringify!(zero_length_array) @@ -211,7 +211,7 @@ fn bindgen_test_layout_C_with_zero_length_array_2() { unsafe { &(*(0 as *const C_with_zero_length_array_2)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_with_zero_length_array_2), "::", stringify!(a) @@ -223,7 +223,7 @@ fn bindgen_test_layout_C_with_zero_length_array_2() { }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_with_zero_length_array_2), "::", stringify!(zero_length_array) @@ -351,7 +351,7 @@ fn bindgen_test_layout_WithDtor() { unsafe { &(*(0 as *const WithDtor)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithDtor), "::", stringify!(b) @@ -403,22 +403,12 @@ fn bindgen_test_layout_Union() { assert_eq!( unsafe { &(*(0 as *const Union)).d as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Union), - "::", - stringify!(d) - ) + concat!("Offset 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) - ) + concat!("Offset of field: ", stringify!(Union), "::", stringify!(i)) ); } impl Clone for Union { @@ -447,7 +437,7 @@ fn bindgen_test_layout_WithUnion() { unsafe { &(*(0 as *const WithUnion)).data as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithUnion), "::", stringify!(data) diff --git a/tests/expectations/tests/class_nested.rs b/tests/expectations/tests/class_nested.rs index e9d02479fb..8d3ac2284c 100644 --- a/tests/expectations/tests/class_nested.rs +++ b/tests/expectations/tests/class_nested.rs @@ -30,7 +30,7 @@ fn bindgen_test_layout_A_B() { unsafe { &(*(0 as *const A_B)).member_b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A_B), "::", stringify!(member_b) @@ -64,7 +64,7 @@ fn bindgen_test_layout_A() { unsafe { &(*(0 as *const A)).member_a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A), "::", stringify!(member_a) @@ -91,12 +91,7 @@ fn bindgen_test_layout_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) - ) + concat!("Offset of field: ", stringify!(A_C), "::", stringify!(baz)) ); } extern "C" { @@ -146,12 +141,7 @@ fn bindgen_test_layout_D() { assert_eq!( unsafe { &(*(0 as *const D)).member as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(D), - "::", - stringify!(member) - ) + concat!("Offset of field: ", stringify!(D), "::", stringify!(member)) ); } #[repr(C)] diff --git a/tests/expectations/tests/class_no_members.rs b/tests/expectations/tests/class_no_members.rs index 01ae947423..f6558b56b7 100644 --- a/tests/expectations/tests/class_no_members.rs +++ b/tests/expectations/tests/class_no_members.rs @@ -61,7 +61,7 @@ fn bindgen_test_layout_whatever_child_with_member() { unsafe { &(*(0 as *const whatever_child_with_member)).m_member as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(whatever_child_with_member), "::", stringify!(m_member) diff --git a/tests/expectations/tests/class_use_as.rs b/tests/expectations/tests/class_use_as.rs index 95b2a7fde0..fe5d1e6c55 100644 --- a/tests/expectations/tests/class_use_as.rs +++ b/tests/expectations/tests/class_use_as.rs @@ -27,7 +27,7 @@ fn bindgen_test_layout_whatever() { unsafe { &(*(0 as *const whatever)).replacement as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(whatever), "::", stringify!(replacement) @@ -55,7 +55,7 @@ fn bindgen_test_layout_container() { unsafe { &(*(0 as *const container)).c as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(container), "::", stringify!(c) diff --git a/tests/expectations/tests/class_with_dtor.rs b/tests/expectations/tests/class_with_dtor.rs index 36ad630722..733aa07194 100644 --- a/tests/expectations/tests/class_with_dtor.rs +++ b/tests/expectations/tests/class_with_dtor.rs @@ -37,7 +37,7 @@ fn bindgen_test_layout_WithoutDtor() { unsafe { &(*(0 as *const WithoutDtor)).shouldBeWithDtor as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithoutDtor), "::", stringify!(shouldBeWithDtor) diff --git a/tests/expectations/tests/class_with_inner_struct.rs b/tests/expectations/tests/class_with_inner_struct.rs index 4848bc1766..02c7fd0adc 100644 --- a/tests/expectations/tests/class_with_inner_struct.rs +++ b/tests/expectations/tests/class_with_inner_struct.rs @@ -33,7 +33,7 @@ fn bindgen_test_layout_A_Segment() { unsafe { &(*(0 as *const A_Segment)).begin as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A_Segment), "::", stringify!(begin) @@ -43,7 +43,7 @@ fn bindgen_test_layout_A_Segment() { unsafe { &(*(0 as *const A_Segment)).end as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A_Segment), "::", stringify!(end) @@ -72,7 +72,7 @@ fn bindgen_test_layout_A__bindgen_ty_1() { unsafe { &(*(0 as *const A__bindgen_ty_1)).f as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A__bindgen_ty_1), "::", stringify!(f) @@ -106,7 +106,7 @@ fn bindgen_test_layout_A__bindgen_ty_2() { unsafe { &(*(0 as *const A__bindgen_ty_2)).d as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A__bindgen_ty_2), "::", stringify!(d) @@ -133,13 +133,13 @@ fn bindgen_test_layout_A() { assert_eq!( unsafe { &(*(0 as *const A)).c as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(A), "::", stringify!(c)) + concat!("Offset of field: ", stringify!(A), "::", stringify!(c)) ); assert_eq!( unsafe { &(*(0 as *const A)).named_union as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A), "::", stringify!(named_union) @@ -178,7 +178,7 @@ fn bindgen_test_layout_B_Segment() { unsafe { &(*(0 as *const B_Segment)).begin as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(B_Segment), "::", stringify!(begin) @@ -188,7 +188,7 @@ fn bindgen_test_layout_B_Segment() { unsafe { &(*(0 as *const B_Segment)).end as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(B_Segment), "::", stringify!(end) @@ -210,7 +210,7 @@ fn bindgen_test_layout_B() { assert_eq!( unsafe { &(*(0 as *const B)).d as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(B), "::", stringify!(d)) + concat!("Offset of field: ", stringify!(B), "::", stringify!(d)) ); } #[repr(i32)] @@ -258,7 +258,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_1)).mX1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_1), "::", stringify!(mX1) @@ -268,7 +268,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_1)).mY1 as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_1), "::", stringify!(mY1) @@ -278,7 +278,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_1)).mX2 as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_1), "::", stringify!(mX2) @@ -288,7 +288,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_1)).mY2 as *const _ as usize }, 12usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_1), "::", stringify!(mY2) @@ -317,7 +317,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_2)).mStepSyntax as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_2), "::", stringify!(mStepSyntax) @@ -327,7 +327,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_2)).mSteps as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_2), "::", stringify!(mSteps) @@ -355,7 +355,7 @@ fn bindgen_test_layout_C__bindgen_ty_1() { unsafe { &(*(0 as *const C__bindgen_ty_1)).mFunc as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1), "::", stringify!(mFunc) @@ -389,7 +389,7 @@ fn bindgen_test_layout_C_Segment() { unsafe { &(*(0 as *const C_Segment)).begin as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_Segment), "::", stringify!(begin) @@ -399,7 +399,7 @@ fn bindgen_test_layout_C_Segment() { unsafe { &(*(0 as *const C_Segment)).end as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_Segment), "::", stringify!(end) @@ -421,7 +421,7 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).d as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(d)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(d)) ); } impl Default for C { diff --git a/tests/expectations/tests/class_with_inner_struct_1_0.rs b/tests/expectations/tests/class_with_inner_struct_1_0.rs index 07a2fe4806..f37c0f93ce 100644 --- a/tests/expectations/tests/class_with_inner_struct_1_0.rs +++ b/tests/expectations/tests/class_with_inner_struct_1_0.rs @@ -76,7 +76,7 @@ fn bindgen_test_layout_A_Segment() { unsafe { &(*(0 as *const A_Segment)).begin as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A_Segment), "::", stringify!(begin) @@ -86,7 +86,7 @@ fn bindgen_test_layout_A_Segment() { unsafe { &(*(0 as *const A_Segment)).end as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A_Segment), "::", stringify!(end) @@ -120,7 +120,7 @@ fn bindgen_test_layout_A__bindgen_ty_1() { unsafe { &(*(0 as *const A__bindgen_ty_1)).f as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A__bindgen_ty_1), "::", stringify!(f) @@ -154,7 +154,7 @@ fn bindgen_test_layout_A__bindgen_ty_2() { unsafe { &(*(0 as *const A__bindgen_ty_2)).d as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A__bindgen_ty_2), "::", stringify!(d) @@ -181,13 +181,13 @@ fn bindgen_test_layout_A() { assert_eq!( unsafe { &(*(0 as *const A)).c as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(A), "::", stringify!(c)) + concat!("Offset of field: ", stringify!(A), "::", stringify!(c)) ); assert_eq!( unsafe { &(*(0 as *const A)).named_union as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(A), "::", stringify!(named_union) @@ -226,7 +226,7 @@ fn bindgen_test_layout_B_Segment() { unsafe { &(*(0 as *const B_Segment)).begin as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(B_Segment), "::", stringify!(begin) @@ -236,7 +236,7 @@ fn bindgen_test_layout_B_Segment() { unsafe { &(*(0 as *const B_Segment)).end as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(B_Segment), "::", stringify!(end) @@ -263,7 +263,7 @@ fn bindgen_test_layout_B() { assert_eq!( unsafe { &(*(0 as *const B)).d as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(B), "::", stringify!(d)) + concat!("Offset of field: ", stringify!(B), "::", stringify!(d)) ); } impl Clone for B { @@ -316,7 +316,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_1)).mX1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_1), "::", stringify!(mX1) @@ -326,7 +326,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_1)).mY1 as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_1), "::", stringify!(mY1) @@ -336,7 +336,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_1)).mX2 as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_1), "::", stringify!(mX2) @@ -346,7 +346,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_1)).mY2 as *const _ as usize }, 12usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_1), "::", stringify!(mY2) @@ -380,7 +380,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_2)).mStepSyntax as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_2), "::", stringify!(mStepSyntax) @@ -390,7 +390,7 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const C__bindgen_ty_1__bindgen_ty_2)).mSteps as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1__bindgen_ty_2), "::", stringify!(mSteps) @@ -423,7 +423,7 @@ fn bindgen_test_layout_C__bindgen_ty_1() { unsafe { &(*(0 as *const C__bindgen_ty_1)).mFunc as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C__bindgen_ty_1), "::", stringify!(mFunc) @@ -457,7 +457,7 @@ fn bindgen_test_layout_C_Segment() { unsafe { &(*(0 as *const C_Segment)).begin as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_Segment), "::", stringify!(begin) @@ -467,7 +467,7 @@ fn bindgen_test_layout_C_Segment() { unsafe { &(*(0 as *const C_Segment)).end as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C_Segment), "::", stringify!(end) @@ -494,7 +494,7 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).d as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(d)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(d)) ); } impl Clone for C { diff --git a/tests/expectations/tests/class_with_typedef.rs b/tests/expectations/tests/class_with_typedef.rs index 459d580c47..b560567e45 100644 --- a/tests/expectations/tests/class_with_typedef.rs +++ b/tests/expectations/tests/class_with_typedef.rs @@ -31,28 +31,28 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).c as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(c)) + concat!("Offset 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)) + concat!("Offset 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)) + concat!("Offset 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)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(d)) ); assert_eq!( unsafe { &(*(0 as *const C)).other_ptr as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(other_ptr) @@ -119,7 +119,7 @@ fn bindgen_test_layout_D() { assert_eq!( unsafe { &(*(0 as *const D)).ptr as *const _ as usize }, 72usize, - concat!("Alignment of field: ", stringify!(D), "::", stringify!(ptr)) + concat!("Offset of field: ", stringify!(D), "::", stringify!(ptr)) ); } impl Default for D { diff --git a/tests/expectations/tests/comment-indent.rs b/tests/expectations/tests/comment-indent.rs index 4fe2b5eb50..8d69a34cec 100644 --- a/tests/expectations/tests/comment-indent.rs +++ b/tests/expectations/tests/comment-indent.rs @@ -83,7 +83,7 @@ pub mod root { unsafe { &(*(0 as *const Baz)).member as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Baz), "::", stringify!(member) diff --git a/tests/expectations/tests/complex.rs b/tests/expectations/tests/complex.rs index 02c8714c5a..1fb70fa130 100644 --- a/tests/expectations/tests/complex.rs +++ b/tests/expectations/tests/complex.rs @@ -31,7 +31,7 @@ fn bindgen_test_layout_TestDouble() { unsafe { &(*(0 as *const TestDouble)).mMember as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(TestDouble), "::", stringify!(mMember) @@ -59,7 +59,7 @@ fn bindgen_test_layout_TestDoublePtr() { unsafe { &(*(0 as *const TestDoublePtr)).mMember as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(TestDoublePtr), "::", stringify!(mMember) @@ -92,7 +92,7 @@ fn bindgen_test_layout_TestFloat() { unsafe { &(*(0 as *const TestFloat)).mMember as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(TestFloat), "::", stringify!(mMember) @@ -120,7 +120,7 @@ fn bindgen_test_layout_TestFloatPtr() { unsafe { &(*(0 as *const TestFloatPtr)).mMember as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(TestFloatPtr), "::", stringify!(mMember) diff --git a/tests/expectations/tests/constify-all-enums.rs b/tests/expectations/tests/constify-all-enums.rs index 3b37daf301..4079737178 100644 --- a/tests/expectations/tests/constify-all-enums.rs +++ b/tests/expectations/tests/constify-all-enums.rs @@ -29,7 +29,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).this_should_work as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(this_should_work) diff --git a/tests/expectations/tests/constify-module-enums-basic.rs b/tests/expectations/tests/constify-module-enums-basic.rs index 6c56e2ec52..d4b6572e95 100644 --- a/tests/expectations/tests/constify-module-enums-basic.rs +++ b/tests/expectations/tests/constify-module-enums-basic.rs @@ -33,7 +33,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).this_should_work as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(this_should_work) diff --git a/tests/expectations/tests/constify-module-enums-namespace.rs b/tests/expectations/tests/constify-module-enums-namespace.rs index b09f837dd7..1f8b3c1277 100644 --- a/tests/expectations/tests/constify-module-enums-namespace.rs +++ b/tests/expectations/tests/constify-module-enums-namespace.rs @@ -45,7 +45,7 @@ pub mod root { unsafe { &(*(0 as *const bar)).this_should_work as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(this_should_work) diff --git a/tests/expectations/tests/constify-module-enums-shadow-name.rs b/tests/expectations/tests/constify-module-enums-shadow-name.rs index 1f2b4b2ffa..33f25b5077 100644 --- a/tests/expectations/tests/constify-module-enums-shadow-name.rs +++ b/tests/expectations/tests/constify-module-enums-shadow-name.rs @@ -32,7 +32,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member) diff --git a/tests/expectations/tests/constify-module-enums-simple-alias.rs b/tests/expectations/tests/constify-module-enums-simple-alias.rs index 0387ddd06d..0420342865 100644 --- a/tests/expectations/tests/constify-module-enums-simple-alias.rs +++ b/tests/expectations/tests/constify-module-enums-simple-alias.rs @@ -40,48 +40,28 @@ fn bindgen_test_layout_Bar() { assert_eq!( unsafe { &(*(0 as *const Bar)).baz1 as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(baz1) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz1)) ); assert_eq!( unsafe { &(*(0 as *const Bar)).baz2 as *const _ as usize }, 4usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(baz2) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz2)) ); assert_eq!( unsafe { &(*(0 as *const Bar)).baz3 as *const _ as usize }, 8usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(baz3) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz3)) ); assert_eq!( unsafe { &(*(0 as *const Bar)).baz4 as *const _ as usize }, 12usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(baz4) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz4)) ); assert_eq!( unsafe { &(*(0 as *const Bar)).baz_ptr1 as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Bar), "::", stringify!(baz_ptr1) @@ -91,7 +71,7 @@ fn bindgen_test_layout_Bar() { unsafe { &(*(0 as *const Bar)).baz_ptr2 as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Bar), "::", stringify!(baz_ptr2) @@ -101,7 +81,7 @@ fn bindgen_test_layout_Bar() { unsafe { &(*(0 as *const Bar)).baz_ptr3 as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Bar), "::", stringify!(baz_ptr3) @@ -111,7 +91,7 @@ fn bindgen_test_layout_Bar() { unsafe { &(*(0 as *const Bar)).baz_ptr4 as *const _ as usize }, 40usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Bar), "::", stringify!(baz_ptr4) diff --git a/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs b/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs index 7fb4606f20..7927f3b082 100644 --- a/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs +++ b/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs @@ -30,22 +30,12 @@ fn bindgen_test_layout_Bar() { assert_eq!( unsafe { &(*(0 as *const Bar)).baz1 as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(baz1) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz1)) ); assert_eq!( unsafe { &(*(0 as *const Bar)).baz2 as *const _ as usize }, 8usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(baz2) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz2)) ); } impl Default for Bar { diff --git a/tests/expectations/tests/constify-module-enums-types.rs b/tests/expectations/tests/constify-module-enums-types.rs index cc1f3d4cd6..c5cd9a3d4c 100644 --- a/tests/expectations/tests/constify-module-enums-types.rs +++ b/tests/expectations/tests/constify-module-enums-types.rs @@ -66,7 +66,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member1) @@ -76,7 +76,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member2 as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member2) @@ -86,7 +86,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member3 as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member3) @@ -96,7 +96,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member4 as *const _ as usize }, 12usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member4) @@ -106,7 +106,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member5 as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member5) @@ -116,7 +116,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member6 as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member6) @@ -126,7 +126,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member7 as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member7) @@ -136,7 +136,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member8 as *const _ as usize }, 36usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member8) @@ -146,7 +146,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member9 as *const _ as usize }, 40usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member9) @@ -156,7 +156,7 @@ fn bindgen_test_layout_bar() { unsafe { &(*(0 as *const bar)).member10 as *const _ as usize }, 44usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bar), "::", stringify!(member10) @@ -189,7 +189,7 @@ fn bindgen_test_layout_Baz() { unsafe { &(*(0 as *const Baz)).member1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Baz), "::", stringify!(member1) @@ -226,12 +226,7 @@ fn bindgen_test_layout_Bar() { assert_eq!( unsafe { &(*(0 as *const Bar)).baz as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz)) ); } impl Default for Bar { diff --git a/tests/expectations/tests/contains-vs-inherits-zero-sized.rs b/tests/expectations/tests/contains-vs-inherits-zero-sized.rs index b567bbbd71..c649171bdf 100644 --- a/tests/expectations/tests/contains-vs-inherits-zero-sized.rs +++ b/tests/expectations/tests/contains-vs-inherits-zero-sized.rs @@ -47,7 +47,7 @@ fn bindgen_test_layout_Inherits() { unsafe { &(*(0 as *const Inherits)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Inherits), "::", stringify!(b) @@ -78,7 +78,7 @@ fn bindgen_test_layout_Contains() { unsafe { &(*(0 as *const Contains)).empty as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Contains), "::", stringify!(empty) @@ -88,7 +88,7 @@ fn bindgen_test_layout_Contains() { unsafe { &(*(0 as *const Contains)).b as *const _ as usize }, 1usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Contains), "::", stringify!(b) diff --git a/tests/expectations/tests/convert-cpp-comment-to-rust.rs b/tests/expectations/tests/convert-cpp-comment-to-rust.rs index b471386a92..cad54c29cd 100644 --- a/tests/expectations/tests/convert-cpp-comment-to-rust.rs +++ b/tests/expectations/tests/convert-cpp-comment-to-rust.rs @@ -32,7 +32,7 @@ fn bindgen_test_layout_mbedtls_mpi() { unsafe { &(*(0 as *const mbedtls_mpi)).s as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(mbedtls_mpi), "::", stringify!(s) @@ -42,7 +42,7 @@ fn bindgen_test_layout_mbedtls_mpi() { unsafe { &(*(0 as *const mbedtls_mpi)).n as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(mbedtls_mpi), "::", stringify!(n) @@ -52,7 +52,7 @@ fn bindgen_test_layout_mbedtls_mpi() { unsafe { &(*(0 as *const mbedtls_mpi)).p as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(mbedtls_mpi), "::", stringify!(p) diff --git a/tests/expectations/tests/convert-floats.rs b/tests/expectations/tests/convert-floats.rs index 87554a2c1a..c46cf6d4a7 100644 --- a/tests/expectations/tests/convert-floats.rs +++ b/tests/expectations/tests/convert-floats.rs @@ -35,38 +35,23 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); assert_eq!( unsafe { &(*(0 as *const foo)).baz as *const _ as usize }, 4usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(baz)) ); assert_eq!( unsafe { &(*(0 as *const foo)).bazz as *const _ as usize }, 8usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bazz) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bazz)) ); assert_eq!( unsafe { &(*(0 as *const foo)).bazzz as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo), "::", stringify!(bazzz) @@ -76,7 +61,7 @@ fn bindgen_test_layout_foo() { unsafe { &(*(0 as *const foo)).complexFloat as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo), "::", stringify!(complexFloat) @@ -86,7 +71,7 @@ fn bindgen_test_layout_foo() { unsafe { &(*(0 as *const foo)).complexDouble as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo), "::", stringify!(complexDouble) diff --git a/tests/expectations/tests/derive-bitfield-method-same-name.rs b/tests/expectations/tests/derive-bitfield-method-same-name.rs index 620508866c..732bc7c8dc 100644 --- a/tests/expectations/tests/derive-bitfield-method-same-name.rs +++ b/tests/expectations/tests/derive-bitfield-method-same-name.rs @@ -31,7 +31,7 @@ fn bindgen_test_layout_Foo() { unsafe { &(*(0 as *const Foo)).large as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Foo), "::", stringify!(large) diff --git a/tests/expectations/tests/derive-clone.rs b/tests/expectations/tests/derive-clone.rs index 356d93e336..5f22e827cf 100644 --- a/tests/expectations/tests/derive-clone.rs +++ b/tests/expectations/tests/derive-clone.rs @@ -27,7 +27,7 @@ fn bindgen_test_layout_ShouldDeriveClone() { unsafe { &(*(0 as *const ShouldDeriveClone)).large as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldDeriveClone), "::", stringify!(large) diff --git a/tests/expectations/tests/derive-clone_1_0.rs b/tests/expectations/tests/derive-clone_1_0.rs index 2ead68ee1d..5e493e6cfe 100644 --- a/tests/expectations/tests/derive-clone_1_0.rs +++ b/tests/expectations/tests/derive-clone_1_0.rs @@ -28,7 +28,7 @@ fn bindgen_test_layout_ShouldImplClone() { unsafe { &(*(0 as *const ShouldImplClone)).large as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldImplClone), "::", stringify!(large) diff --git a/tests/expectations/tests/derive-debug-bitfield.rs b/tests/expectations/tests/derive-debug-bitfield.rs index d664a4bafe..2e2bbdedbd 100644 --- a/tests/expectations/tests/derive-debug-bitfield.rs +++ b/tests/expectations/tests/derive-debug-bitfield.rs @@ -26,7 +26,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).large_array as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(large_array) diff --git a/tests/expectations/tests/derive-debug-function-pointer.rs b/tests/expectations/tests/derive-debug-function-pointer.rs index 01ffe206ac..25a0f73718 100644 --- a/tests/expectations/tests/derive-debug-function-pointer.rs +++ b/tests/expectations/tests/derive-debug-function-pointer.rs @@ -27,7 +27,7 @@ fn bindgen_test_layout_Nice() { unsafe { &(*(0 as *const Nice)).pointer as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Nice), "::", stringify!(pointer) @@ -37,7 +37,7 @@ fn bindgen_test_layout_Nice() { unsafe { &(*(0 as *const Nice)).large_array as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Nice), "::", stringify!(large_array) diff --git a/tests/expectations/tests/derive-debug-mangle-name.rs b/tests/expectations/tests/derive-debug-mangle-name.rs index 4f2161fb79..3b25664d5c 100644 --- a/tests/expectations/tests/derive-debug-mangle-name.rs +++ b/tests/expectations/tests/derive-debug-mangle-name.rs @@ -34,7 +34,7 @@ fn bindgen_test_layout_perf_event_attr__bindgen_ty_1() { unsafe { &(*(0 as *const perf_event_attr__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(perf_event_attr__bindgen_ty_1), "::", stringify!(b) @@ -44,7 +44,7 @@ fn bindgen_test_layout_perf_event_attr__bindgen_ty_1() { unsafe { &(*(0 as *const perf_event_attr__bindgen_ty_1)).c as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(perf_event_attr__bindgen_ty_1), "::", stringify!(c) @@ -77,7 +77,7 @@ fn bindgen_test_layout_perf_event_attr() { unsafe { &(*(0 as *const perf_event_attr)).type_ as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(perf_event_attr), "::", stringify!(type_) @@ -87,7 +87,7 @@ fn bindgen_test_layout_perf_event_attr() { unsafe { &(*(0 as *const perf_event_attr)).a as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(perf_event_attr), "::", stringify!(a) diff --git a/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs b/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs index 5bc6e20dfc..058b3cc8f9 100644 --- a/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs +++ b/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs @@ -24,7 +24,7 @@ fn bindgen_test_layout_Instance() { unsafe { &(*(0 as *const Instance)).val as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Instance), "::", stringify!(val) diff --git a/tests/expectations/tests/derive-debug-opaque.rs b/tests/expectations/tests/derive-debug-opaque.rs index 29c1d79154..128cfe7e09 100644 --- a/tests/expectations/tests/derive-debug-opaque.rs +++ b/tests/expectations/tests/derive-debug-opaque.rs @@ -51,7 +51,7 @@ fn bindgen_test_layout_OpaqueUser() { unsafe { &(*(0 as *const OpaqueUser)).opaque as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(OpaqueUser), "::", stringify!(opaque) diff --git a/tests/expectations/tests/derive-default-and-blacklist.rs b/tests/expectations/tests/derive-default-and-blacklist.rs index d6a8bc752d..698caf0bac 100644 --- a/tests/expectations/tests/derive-default-and-blacklist.rs +++ b/tests/expectations/tests/derive-default-and-blacklist.rs @@ -28,7 +28,7 @@ fn bindgen_test_layout_ShouldNotDeriveDefault() { unsafe { &(*(0 as *const ShouldNotDeriveDefault)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldNotDeriveDefault), "::", stringify!(a) diff --git a/tests/expectations/tests/derive-fn-ptr.rs b/tests/expectations/tests/derive-fn-ptr.rs index 382d906359..51efa7afc0 100644 --- a/tests/expectations/tests/derive-fn-ptr.rs +++ b/tests/expectations/tests/derive-fn-ptr.rs @@ -45,7 +45,7 @@ fn bindgen_test_layout_Foo() { unsafe { &(*(0 as *const Foo)).callback as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Foo), "::", stringify!(callback) @@ -94,7 +94,7 @@ fn bindgen_test_layout_Bar() { unsafe { &(*(0 as *const Bar)).callback as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Bar), "::", stringify!(callback) diff --git a/tests/expectations/tests/derive-hash-and-blacklist.rs b/tests/expectations/tests/derive-hash-and-blacklist.rs index bdbdc9ae8e..31e3415a0e 100644 --- a/tests/expectations/tests/derive-hash-and-blacklist.rs +++ b/tests/expectations/tests/derive-hash-and-blacklist.rs @@ -27,7 +27,7 @@ fn bindgen_test_layout_ShouldNotDeriveHash() { unsafe { &(*(0 as *const ShouldNotDeriveHash)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldNotDeriveHash), "::", stringify!(a) diff --git a/tests/expectations/tests/derive-hash-blacklisting.rs b/tests/expectations/tests/derive-hash-blacklisting.rs index c9cbf6efd1..a371536d5f 100644 --- a/tests/expectations/tests/derive-hash-blacklisting.rs +++ b/tests/expectations/tests/derive-hash-blacklisting.rs @@ -33,7 +33,7 @@ fn bindgen_test_layout_WhitelistedOne() { unsafe { &(*(0 as *const WhitelistedOne)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WhitelistedOne), "::", stringify!(a) @@ -66,7 +66,7 @@ fn bindgen_test_layout_WhitelistedTwo() { unsafe { &(*(0 as *const WhitelistedTwo)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WhitelistedTwo), "::", stringify!(b) diff --git a/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs b/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs index b4f93f73ee..5a0afd9ba6 100644 --- a/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs +++ b/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs @@ -33,7 +33,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -43,7 +43,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -65,11 +65,6 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } diff --git a/tests/expectations/tests/derive-hash-struct-with-float-array.rs b/tests/expectations/tests/derive-hash-struct-with-float-array.rs index d736c11426..5b65ddcda9 100644 --- a/tests/expectations/tests/derive-hash-struct-with-float-array.rs +++ b/tests/expectations/tests/derive-hash-struct-with-float-array.rs @@ -26,11 +26,6 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } diff --git a/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs b/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs index a2179f417d..d5173421ad 100644 --- a/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs +++ b/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs @@ -62,18 +62,13 @@ fn bindgen_test_layout_test() { assert_eq!( unsafe { &(*(0 as *const test)).a as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(test), - "::", - stringify!(a) - ) + concat!("Offset of field: ", stringify!(test), "::", stringify!(a)) ); assert_eq!( unsafe { &(*(0 as *const test)).zero_length_array as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(test), "::", stringify!(zero_length_array) diff --git a/tests/expectations/tests/derive-hash-struct-with-pointer.rs b/tests/expectations/tests/derive-hash-struct-with-pointer.rs index 7ff50fcf5b..4192726d05 100644 --- a/tests/expectations/tests/derive-hash-struct-with-pointer.rs +++ b/tests/expectations/tests/derive-hash-struct-with-pointer.rs @@ -27,7 +27,7 @@ fn bindgen_test_layout_ConstPtrMutObj() { unsafe { &(*(0 as *const ConstPtrMutObj)).bar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ConstPtrMutObj), "::", stringify!(bar) @@ -60,7 +60,7 @@ fn bindgen_test_layout_MutPtrMutObj() { unsafe { &(*(0 as *const MutPtrMutObj)).bar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(MutPtrMutObj), "::", stringify!(bar) @@ -93,7 +93,7 @@ fn bindgen_test_layout_MutPtrConstObj() { unsafe { &(*(0 as *const MutPtrConstObj)).bar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(MutPtrConstObj), "::", stringify!(bar) @@ -126,7 +126,7 @@ fn bindgen_test_layout_ConstPtrConstObj() { unsafe { &(*(0 as *const ConstPtrConstObj)).bar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ConstPtrConstObj), "::", stringify!(bar) diff --git a/tests/expectations/tests/derive-hash-template-inst-float.rs b/tests/expectations/tests/derive-hash-template-inst-float.rs index 4fd935aa71..ea53b9eca6 100644 --- a/tests/expectations/tests/derive-hash-template-inst-float.rs +++ b/tests/expectations/tests/derive-hash-template-inst-float.rs @@ -38,12 +38,7 @@ fn bindgen_test_layout_IntStr() { assert_eq!( unsafe { &(*(0 as *const IntStr)).a as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(IntStr), - "::", - stringify!(a) - ) + concat!("Offset of field: ", stringify!(IntStr), "::", stringify!(a)) ); } impl Default for IntStr { @@ -73,7 +68,7 @@ fn bindgen_test_layout_FloatStr() { unsafe { &(*(0 as *const FloatStr)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(FloatStr), "::", stringify!(a) diff --git a/tests/expectations/tests/derive-partialeq-and-blacklist.rs b/tests/expectations/tests/derive-partialeq-and-blacklist.rs index 28f8ff53cb..4d55c8b8eb 100644 --- a/tests/expectations/tests/derive-partialeq-and-blacklist.rs +++ b/tests/expectations/tests/derive-partialeq-and-blacklist.rs @@ -28,7 +28,7 @@ fn bindgen_test_layout_ShouldNotDerivePartialEq() { unsafe { &(*(0 as *const ShouldNotDerivePartialEq)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldNotDerivePartialEq), "::", stringify!(a) diff --git a/tests/expectations/tests/derive-partialeq-base.rs b/tests/expectations/tests/derive-partialeq-base.rs index cb86ebe68d..8fc0b61f30 100644 --- a/tests/expectations/tests/derive-partialeq-base.rs +++ b/tests/expectations/tests/derive-partialeq-base.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_Base() { unsafe { &(*(0 as *const Base)).large as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Base), "::", stringify!(large) diff --git a/tests/expectations/tests/derive-partialeq-bitfield.rs b/tests/expectations/tests/derive-partialeq-bitfield.rs index b9e2db2917..727bbf0e04 100644 --- a/tests/expectations/tests/derive-partialeq-bitfield.rs +++ b/tests/expectations/tests/derive-partialeq-bitfield.rs @@ -26,7 +26,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).large_array as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(large_array) diff --git a/tests/expectations/tests/derive-partialeq-core.rs b/tests/expectations/tests/derive-partialeq-core.rs index 7b925fba7b..b8f6def75c 100644 --- a/tests/expectations/tests/derive-partialeq-core.rs +++ b/tests/expectations/tests/derive-partialeq-core.rs @@ -26,7 +26,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).large_array as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(large_array) diff --git a/tests/expectations/tests/derive-partialeq-pointer.rs b/tests/expectations/tests/derive-partialeq-pointer.rs index 52a4bf7149..83747b1456 100644 --- a/tests/expectations/tests/derive-partialeq-pointer.rs +++ b/tests/expectations/tests/derive-partialeq-pointer.rs @@ -24,7 +24,7 @@ fn bindgen_test_layout_Bar() { assert_eq!( unsafe { &(*(0 as *const Bar)).b as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(Bar), "::", stringify!(b)) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(b)) ); } impl Default for Bar { @@ -99,7 +99,7 @@ fn bindgen_test_layout_a() { assert_eq!( unsafe { &(*(0 as *const a)).d as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(a), "::", stringify!(d)) + concat!("Offset of field: ", stringify!(a), "::", stringify!(d)) ); } impl Default for a { diff --git a/tests/expectations/tests/derive-partialeq-union.rs b/tests/expectations/tests/derive-partialeq-union.rs index c264206287..8e257339e3 100644 --- a/tests/expectations/tests/derive-partialeq-union.rs +++ b/tests/expectations/tests/derive-partialeq-union.rs @@ -29,7 +29,7 @@ fn bindgen_test_layout_ShouldNotDerivePartialEq() { unsafe { &(*(0 as *const ShouldNotDerivePartialEq)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldNotDerivePartialEq), "::", stringify!(a) @@ -39,7 +39,7 @@ fn bindgen_test_layout_ShouldNotDerivePartialEq() { unsafe { &(*(0 as *const ShouldNotDerivePartialEq)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldNotDerivePartialEq), "::", stringify!(b) diff --git a/tests/expectations/tests/derive-partialeq-union_1_0.rs b/tests/expectations/tests/derive-partialeq-union_1_0.rs index 32a0635272..35518c0d70 100644 --- a/tests/expectations/tests/derive-partialeq-union_1_0.rs +++ b/tests/expectations/tests/derive-partialeq-union_1_0.rs @@ -71,7 +71,7 @@ fn bindgen_test_layout_ShouldDerivePartialEq() { unsafe { &(*(0 as *const ShouldDerivePartialEq)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldDerivePartialEq), "::", stringify!(a) @@ -81,7 +81,7 @@ fn bindgen_test_layout_ShouldDerivePartialEq() { unsafe { &(*(0 as *const ShouldDerivePartialEq)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldDerivePartialEq), "::", stringify!(b) diff --git a/tests/expectations/tests/divide-by-zero-in-struct-layout.rs b/tests/expectations/tests/divide-by-zero-in-struct-layout.rs index 9fb429af12..1f738e869b 100644 --- a/tests/expectations/tests/divide-by-zero-in-struct-layout.rs +++ b/tests/expectations/tests/divide-by-zero-in-struct-layout.rs @@ -30,12 +30,11 @@ impl WithBitfieldAndAttrPacked { 0 } } -#[repr(C, packed)] +#[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct WithBitfieldAndPacked { pub _bitfield_1: [u8; 0usize], pub a: ::std::os::raw::c_uint, - pub __bindgen_padding_0: u8, } impl WithBitfieldAndPacked { #[inline] diff --git a/tests/expectations/tests/do-not-derive-copy.rs b/tests/expectations/tests/do-not-derive-copy.rs index 9830777455..fd7ff3012c 100644 --- a/tests/expectations/tests/do-not-derive-copy.rs +++ b/tests/expectations/tests/do-not-derive-copy.rs @@ -28,7 +28,7 @@ fn bindgen_test_layout_WouldBeCopyButWeAreNotDerivingCopy() { unsafe { &(*(0 as *const WouldBeCopyButWeAreNotDerivingCopy)).x as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WouldBeCopyButWeAreNotDerivingCopy), "::", stringify!(x) diff --git a/tests/expectations/tests/doggo-or-null.rs b/tests/expectations/tests/doggo-or-null.rs index 2da07dedb0..e87949e705 100644 --- a/tests/expectations/tests/doggo-or-null.rs +++ b/tests/expectations/tests/doggo-or-null.rs @@ -24,12 +24,7 @@ fn bindgen_test_layout_Doggo() { assert_eq!( unsafe { &(*(0 as *const Doggo)).x as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Doggo), - "::", - stringify!(x) - ) + concat!("Offset of field: ", stringify!(Doggo), "::", stringify!(x)) ); } #[repr(C)] diff --git a/tests/expectations/tests/duplicated-namespaces-definitions.rs b/tests/expectations/tests/duplicated-namespaces-definitions.rs index 9732849c81..1fa1c73ece 100644 --- a/tests/expectations/tests/duplicated-namespaces-definitions.rs +++ b/tests/expectations/tests/duplicated-namespaces-definitions.rs @@ -32,22 +32,12 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const Bar)).foo as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(foo) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(foo)) ); assert_eq!( unsafe { &(*(0 as *const Bar)).baz as *const _ as usize }, 4usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz)) ); } } @@ -74,12 +64,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const Foo)).ptr as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Foo), - "::", - stringify!(ptr) - ) + concat!("Offset of field: ", stringify!(Foo), "::", stringify!(ptr)) ); } impl Default for Foo { diff --git a/tests/expectations/tests/enum_and_vtable_mangling.rs b/tests/expectations/tests/enum_and_vtable_mangling.rs index ffdcedd5e6..71c1d07948 100644 --- a/tests/expectations/tests/enum_and_vtable_mangling.rs +++ b/tests/expectations/tests/enum_and_vtable_mangling.rs @@ -35,7 +35,7 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).i as *const _ as usize }, 8usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(i)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(i)) ); } impl Default for C { diff --git a/tests/expectations/tests/forward-declaration-autoptr.rs b/tests/expectations/tests/forward-declaration-autoptr.rs index 8ad45f10e9..c7edbec02d 100644 --- a/tests/expectations/tests/forward-declaration-autoptr.rs +++ b/tests/expectations/tests/forward-declaration-autoptr.rs @@ -41,7 +41,7 @@ fn bindgen_test_layout_Bar() { unsafe { &(*(0 as *const Bar)).m_member as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Bar), "::", stringify!(m_member) diff --git a/tests/expectations/tests/forward_declared_complex_types.rs b/tests/expectations/tests/forward_declared_complex_types.rs index ceab52d744..5fc83a1869 100644 --- a/tests/expectations/tests/forward_declared_complex_types.rs +++ b/tests/expectations/tests/forward_declared_complex_types.rs @@ -47,7 +47,7 @@ fn bindgen_test_layout_Bar() { assert_eq!( unsafe { &(*(0 as *const Bar)).f as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(Bar), "::", stringify!(f)) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(f)) ); } impl Default for Bar { diff --git a/tests/expectations/tests/forward_declared_complex_types_1_0.rs b/tests/expectations/tests/forward_declared_complex_types_1_0.rs index a4eaa17c8f..248ccd8210 100644 --- a/tests/expectations/tests/forward_declared_complex_types_1_0.rs +++ b/tests/expectations/tests/forward_declared_complex_types_1_0.rs @@ -52,7 +52,7 @@ fn bindgen_test_layout_Bar() { assert_eq!( unsafe { &(*(0 as *const Bar)).f as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(Bar), "::", stringify!(f)) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(f)) ); } impl Clone for Bar { diff --git a/tests/expectations/tests/forward_declared_struct.rs b/tests/expectations/tests/forward_declared_struct.rs index 001d6df096..7cc7c43e62 100644 --- a/tests/expectations/tests/forward_declared_struct.rs +++ b/tests/expectations/tests/forward_declared_struct.rs @@ -24,7 +24,7 @@ fn bindgen_test_layout_a() { assert_eq!( unsafe { &(*(0 as *const a)).b as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(a), "::", stringify!(b)) + concat!("Offset of field: ", stringify!(a), "::", stringify!(b)) ); } #[repr(C)] @@ -47,6 +47,6 @@ fn bindgen_test_layout_c() { assert_eq!( unsafe { &(*(0 as *const c)).d as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(c), "::", stringify!(d)) + concat!("Offset of field: ", stringify!(c), "::", stringify!(d)) ); } diff --git a/tests/expectations/tests/func_ptr_in_struct.rs b/tests/expectations/tests/func_ptr_in_struct.rs index 5a2c00c73f..7c82aa690c 100644 --- a/tests/expectations/tests/func_ptr_in_struct.rs +++ b/tests/expectations/tests/func_ptr_in_struct.rs @@ -28,12 +28,7 @@ fn bindgen_test_layout_Foo() { assert_eq!( unsafe { &(*(0 as *const Foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(Foo), "::", stringify!(bar)) ); } impl Default for Foo { diff --git a/tests/expectations/tests/gen-destructors-neg.rs b/tests/expectations/tests/gen-destructors-neg.rs index 0f75ce0b35..5ba459f181 100644 --- a/tests/expectations/tests/gen-destructors-neg.rs +++ b/tests/expectations/tests/gen-destructors-neg.rs @@ -24,11 +24,6 @@ fn bindgen_test_layout_Foo() { assert_eq!( unsafe { &(*(0 as *const Foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(Foo), "::", stringify!(bar)) ); } diff --git a/tests/expectations/tests/gen-destructors.rs b/tests/expectations/tests/gen-destructors.rs index a7bf40285d..fbb9017e1e 100644 --- a/tests/expectations/tests/gen-destructors.rs +++ b/tests/expectations/tests/gen-destructors.rs @@ -24,12 +24,7 @@ fn bindgen_test_layout_Foo() { assert_eq!( unsafe { &(*(0 as *const Foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(Foo), "::", stringify!(bar)) ); } extern "C" { diff --git a/tests/expectations/tests/inline_namespace.rs b/tests/expectations/tests/inline_namespace.rs index ade3ce3bb6..d7420755e7 100644 --- a/tests/expectations/tests/inline_namespace.rs +++ b/tests/expectations/tests/inline_namespace.rs @@ -33,12 +33,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const Bar)).baz as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz)) ); } } diff --git a/tests/expectations/tests/inline_namespace_conservative.rs b/tests/expectations/tests/inline_namespace_conservative.rs index 7895a19f5f..6dd85f0405 100644 --- a/tests/expectations/tests/inline_namespace_conservative.rs +++ b/tests/expectations/tests/inline_namespace_conservative.rs @@ -38,12 +38,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const Bar)).baz as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz)) ); } } diff --git a/tests/expectations/tests/inner_const.rs b/tests/expectations/tests/inner_const.rs index 3ea87edb33..63b81f711d 100644 --- a/tests/expectations/tests/inner_const.rs +++ b/tests/expectations/tests/inner_const.rs @@ -32,11 +32,6 @@ fn bindgen_test_layout_Foo() { assert_eq!( unsafe { &(*(0 as *const Foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(Foo), "::", stringify!(bar)) ); } diff --git a/tests/expectations/tests/inner_template_self.rs b/tests/expectations/tests/inner_template_self.rs index bf39e06514..0601f107ed 100644 --- a/tests/expectations/tests/inner_template_self.rs +++ b/tests/expectations/tests/inner_template_self.rs @@ -36,7 +36,7 @@ fn bindgen_test_layout_InstantiateIt() { unsafe { &(*(0 as *const InstantiateIt)).m_list as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(InstantiateIt), "::", stringify!(m_list) diff --git a/tests/expectations/tests/issue-1118-using-forward-decl.rs b/tests/expectations/tests/issue-1118-using-forward-decl.rs index 27537627c2..8952ab9d33 100644 --- a/tests/expectations/tests/issue-1118-using-forward-decl.rs +++ b/tests/expectations/tests/issue-1118-using-forward-decl.rs @@ -26,7 +26,7 @@ fn bindgen_test_layout_nsTArray_base() { unsafe { &(*(0 as *const nsTArray_base)).d as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsTArray_base), "::", stringify!(d) @@ -69,7 +69,7 @@ fn bindgen_test_layout_nsIContent() { unsafe { &(*(0 as *const nsIContent)).foo as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsIContent), "::", stringify!(foo) diff --git a/tests/expectations/tests/issue-372.rs b/tests/expectations/tests/issue-372.rs index 84a33cb9a7..7cbb8904a6 100644 --- a/tests/expectations/tests/issue-372.rs +++ b/tests/expectations/tests/issue-372.rs @@ -30,17 +30,17 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const i)).j as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(i), "::", stringify!(j)) + concat!("Offset of field: ", stringify!(i), "::", stringify!(j)) ); assert_eq!( unsafe { &(*(0 as *const i)).k as *const _ as usize }, 8usize, - concat!("Alignment of field: ", stringify!(i), "::", stringify!(k)) + concat!("Offset of field: ", stringify!(i), "::", stringify!(k)) ); assert_eq!( unsafe { &(*(0 as *const i)).l as *const _ as usize }, 16usize, - concat!("Alignment of field: ", stringify!(i), "::", stringify!(l)) + concat!("Offset of field: ", stringify!(i), "::", stringify!(l)) ); } impl Default for i { @@ -68,7 +68,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const d)).m as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(d), "::", stringify!(m)) + concat!("Offset of field: ", stringify!(d), "::", stringify!(m)) ); } impl Default for d { @@ -111,7 +111,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const F)).w as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(F), "::", stringify!(w)) + concat!("Offset of field: ", stringify!(F), "::", stringify!(w)) ); } impl Default for F { diff --git a/tests/expectations/tests/issue-537.rs b/tests/expectations/tests/issue-537.rs new file mode 100644 index 0000000000..4c43acd5b2 --- /dev/null +++ b/tests/expectations/tests/issue-537.rs @@ -0,0 +1,120 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] + + + +/// This should not be opaque; we can see the attributes and can pack the +/// struct. +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +pub struct AlignedToOne { + pub i: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_AlignedToOne() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(AlignedToOne)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(AlignedToOne)) + ); + assert_eq!( + unsafe { &(*(0 as *const AlignedToOne)).i as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(AlignedToOne), + "::", + stringify!(i) + ) + ); +} +/// This should be opaque because although we can see the attributes, Rust +/// doesn't have `#[repr(packed = "N")]` yet. +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct AlignedToTwo { + pub _bindgen_opaque_blob: [u16; 2usize], +} +#[test] +fn bindgen_test_layout_AlignedToTwo() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(AlignedToTwo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(AlignedToTwo)) + ); +} +/// This should not be opaque because although `libclang` doesn't give us the +/// `#pragma pack(1)`, we can detect that alignment is 1 and add +/// `#[repr(packed)]` to the struct ourselves. +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +pub struct PackedToOne { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_PackedToOne() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(PackedToOne)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(PackedToOne)) + ); + assert_eq!( + unsafe { &(*(0 as *const PackedToOne)).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(PackedToOne), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const PackedToOne)).y as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(PackedToOne), + "::", + stringify!(y) + ) + ); +} +/// In this case, even if we can detect the weird alignment triggered by +/// `#pragma pack(2)`, we can't do anything about it because Rust doesn't have +/// `#[repr(packed = "N")]`. Therefore, we must make it opaque. +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct PackedToTwo { + pub _bindgen_opaque_blob: [u16; 4usize], +} +#[test] +fn bindgen_test_layout_PackedToTwo() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(PackedToTwo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(PackedToTwo)) + ); +} diff --git a/tests/expectations/tests/issue-573-layout-test-failures.rs b/tests/expectations/tests/issue-573-layout-test-failures.rs index ba2ef976b3..0824b81fcb 100644 --- a/tests/expectations/tests/issue-573-layout-test-failures.rs +++ b/tests/expectations/tests/issue-573-layout-test-failures.rs @@ -30,7 +30,7 @@ fn bindgen_test_layout_AutoIdVector() { unsafe { &(*(0 as *const AutoIdVector)).ar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(AutoIdVector), "::", stringify!(ar) diff --git a/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs b/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs index 69a59d5a85..fca2bff003 100644 --- a/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs +++ b/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs @@ -30,7 +30,7 @@ fn bindgen_test_layout__bindgen_ty_1() { unsafe { &(*(0 as *const _bindgen_ty_1)).ar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(_bindgen_ty_1), "::", stringify!(ar) diff --git a/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs b/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs index b6640998d7..89f3c79362 100644 --- a/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs +++ b/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs @@ -58,7 +58,7 @@ fn bindgen_test_layout_g() { assert_eq!( unsafe { &(*(0 as *const g)).h as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(g), "::", stringify!(h)) + concat!("Offset of field: ", stringify!(g), "::", stringify!(h)) ); } impl Default for g { diff --git a/tests/expectations/tests/issue-639-typedef-anon-field.rs b/tests/expectations/tests/issue-639-typedef-anon-field.rs index 91f76531e8..574505c7ed 100644 --- a/tests/expectations/tests/issue-639-typedef-anon-field.rs +++ b/tests/expectations/tests/issue-639-typedef-anon-field.rs @@ -30,7 +30,7 @@ fn bindgen_test_layout_Foo_Bar() { unsafe { &(*(0 as *const Foo_Bar)).abc as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Foo_Bar), "::", stringify!(abc) @@ -52,12 +52,7 @@ fn bindgen_test_layout_Foo() { assert_eq!( unsafe { &(*(0 as *const Foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(Foo), "::", stringify!(bar)) ); } #[repr(C)] @@ -86,7 +81,7 @@ fn bindgen_test_layout_Baz_Bar() { unsafe { &(*(0 as *const Baz_Bar)).abc as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Baz_Bar), "::", stringify!(abc) diff --git a/tests/expectations/tests/issue-643-inner-struct.rs b/tests/expectations/tests/issue-643-inner-struct.rs index ee5416e09f..2aaf644fc7 100644 --- a/tests/expectations/tests/issue-643-inner-struct.rs +++ b/tests/expectations/tests/issue-643-inner-struct.rs @@ -70,7 +70,7 @@ fn bindgen_test_layout_rte_ring_prod() { unsafe { &(*(0 as *const rte_ring_prod)).watermark as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ring_prod), "::", stringify!(watermark) @@ -98,7 +98,7 @@ fn bindgen_test_layout_rte_ring_cons() { unsafe { &(*(0 as *const rte_ring_cons)).sc_dequeue as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ring_cons), "::", stringify!(sc_dequeue) diff --git a/tests/expectations/tests/issue-648-derive-debug-with-padding.rs b/tests/expectations/tests/issue-648-derive-debug-with-padding.rs index a3d594e0ee..8e147675ab 100644 --- a/tests/expectations/tests/issue-648-derive-debug-with-padding.rs +++ b/tests/expectations/tests/issue-648-derive-debug-with-padding.rs @@ -26,7 +26,7 @@ fn bindgen_test_layout_NoDebug() { unsafe { &(*(0 as *const NoDebug)).c as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(NoDebug), "::", stringify!(c) @@ -65,7 +65,7 @@ fn bindgen_test_layout_ShouldDeriveDebugButDoesNot() { unsafe { &(*(0 as *const ShouldDeriveDebugButDoesNot)).c as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldDeriveDebugButDoesNot), "::", stringify!(c) @@ -75,7 +75,7 @@ fn bindgen_test_layout_ShouldDeriveDebugButDoesNot() { unsafe { &(*(0 as *const ShouldDeriveDebugButDoesNot)).d as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldDeriveDebugButDoesNot), "::", stringify!(d) diff --git a/tests/expectations/tests/issue-674-1.rs b/tests/expectations/tests/issue-674-1.rs index fc9ebc11e2..4f06b594a1 100644 --- a/tests/expectations/tests/issue-674-1.rs +++ b/tests/expectations/tests/issue-674-1.rs @@ -39,7 +39,7 @@ pub mod root { unsafe { &(*(0 as *const CapturingContentInfo)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(CapturingContentInfo), "::", stringify!(a) diff --git a/tests/expectations/tests/issue-674-2.rs b/tests/expectations/tests/issue-674-2.rs index 07c9cc4a5c..8da0c0948e 100644 --- a/tests/expectations/tests/issue-674-2.rs +++ b/tests/expectations/tests/issue-674-2.rs @@ -38,7 +38,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const c)).b as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(c), "::", stringify!(b)) + concat!("Offset of field: ", stringify!(c), "::", stringify!(b)) ); } #[repr(C)] @@ -61,7 +61,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const B)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(B), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(B), "::", stringify!(a)) ); } #[repr(C)] diff --git a/tests/expectations/tests/issue-674-3.rs b/tests/expectations/tests/issue-674-3.rs index 1750cc0b24..4a9346089c 100644 --- a/tests/expectations/tests/issue-674-3.rs +++ b/tests/expectations/tests/issue-674-3.rs @@ -34,7 +34,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const a)).b as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(a), "::", stringify!(b)) + concat!("Offset of field: ", stringify!(a), "::", stringify!(b)) ); } #[repr(C)] @@ -58,7 +58,7 @@ pub mod root { unsafe { &(*(0 as *const nsCSSValue)).c as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsCSSValue), "::", stringify!(c) diff --git a/tests/expectations/tests/issue-801-opaque-sloppiness.rs b/tests/expectations/tests/issue-801-opaque-sloppiness.rs index 3dde6e7302..3d843708f5 100644 --- a/tests/expectations/tests/issue-801-opaque-sloppiness.rs +++ b/tests/expectations/tests/issue-801-opaque-sloppiness.rs @@ -51,6 +51,6 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).b as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(b)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(b)) ); } diff --git a/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs b/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs index 0807873b59..7494e001b7 100644 --- a/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs +++ b/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs @@ -121,7 +121,7 @@ fn bindgen_test_layout_Whitelisted() { unsafe { &(*(0 as *const Whitelisted)).some_member as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Whitelisted), "::", stringify!(some_member) diff --git a/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs b/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs index cd3d38c10f..58f51080d9 100644 --- a/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs +++ b/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs @@ -27,7 +27,7 @@ fn bindgen_test_layout_ShouldNotBeCopy() { unsafe { &(*(0 as *const ShouldNotBeCopy)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ShouldNotBeCopy), "::", stringify!(a) diff --git a/tests/expectations/tests/jsval_layout_opaque.rs b/tests/expectations/tests/jsval_layout_opaque.rs index a422ffc052..d75192f9cc 100644 --- a/tests/expectations/tests/jsval_layout_opaque.rs +++ b/tests/expectations/tests/jsval_layout_opaque.rs @@ -223,7 +223,7 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1), "::", stringify!(i32) @@ -235,7 +235,7 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1), "::", stringify!(u32) @@ -247,7 +247,7 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1), "::", stringify!(why) @@ -275,7 +275,7 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2() { unsafe { &(*(0 as *const jsval_layout__bindgen_ty_2)).payload as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout__bindgen_ty_2), "::", stringify!(payload) @@ -303,7 +303,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).asBits as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(asBits) @@ -313,7 +313,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).debugView as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(debugView) @@ -323,7 +323,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).s as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(s) @@ -333,7 +333,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).asDouble as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(asDouble) @@ -343,7 +343,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).asPtr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(asPtr) @@ -353,7 +353,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).asWord as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(asWord) @@ -363,7 +363,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).asUIntPtr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(asUIntPtr) @@ -396,7 +396,7 @@ fn bindgen_test_layout_Value() { unsafe { &(*(0 as *const Value)).data as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Value), "::", stringify!(data) diff --git a/tests/expectations/tests/jsval_layout_opaque_1_0.rs b/tests/expectations/tests/jsval_layout_opaque_1_0.rs index 93a549c552..a4139a3185 100644 --- a/tests/expectations/tests/jsval_layout_opaque_1_0.rs +++ b/tests/expectations/tests/jsval_layout_opaque_1_0.rs @@ -271,7 +271,7 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1), "::", stringify!(i32) @@ -283,7 +283,7 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1), "::", stringify!(u32) @@ -295,7 +295,7 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1), "::", stringify!(why) @@ -323,7 +323,7 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2() { unsafe { &(*(0 as *const jsval_layout__bindgen_ty_2)).payload as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout__bindgen_ty_2), "::", stringify!(payload) @@ -351,7 +351,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).asBits as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(asBits) @@ -361,7 +361,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).debugView as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(debugView) @@ -371,7 +371,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).s as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(s) @@ -381,7 +381,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).asDouble as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(asDouble) @@ -391,7 +391,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).asPtr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(asPtr) @@ -401,7 +401,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).asWord as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(asWord) @@ -411,7 +411,7 @@ fn bindgen_test_layout_jsval_layout() { unsafe { &(*(0 as *const jsval_layout)).asUIntPtr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(jsval_layout), "::", stringify!(asUIntPtr) @@ -444,7 +444,7 @@ fn bindgen_test_layout_Value() { unsafe { &(*(0 as *const Value)).data as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Value), "::", stringify!(data) diff --git a/tests/expectations/tests/layout_align.rs b/tests/expectations/tests/layout_align.rs index 859416d76f..66d7664ae9 100644 --- a/tests/expectations/tests/layout_align.rs +++ b/tests/expectations/tests/layout_align.rs @@ -99,7 +99,7 @@ fn bindgen_test_layout_rte_eth_link() { unsafe { &(*(0 as *const rte_eth_link)).link_speed as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_link), "::", stringify!(link_speed) diff --git a/tests/expectations/tests/layout_arp.rs b/tests/expectations/tests/layout_arp.rs index d49a870b55..e49b87a7b9 100644 --- a/tests/expectations/tests/layout_arp.rs +++ b/tests/expectations/tests/layout_arp.rs @@ -43,7 +43,7 @@ fn bindgen_test_layout_ether_addr() { unsafe { &(*(0 as *const ether_addr)).addr_bytes as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ether_addr), "::", stringify!(addr_bytes) @@ -79,7 +79,7 @@ fn bindgen_test_layout_arp_ipv4() { unsafe { &(*(0 as *const arp_ipv4)).arp_sha as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(arp_ipv4), "::", stringify!(arp_sha) @@ -89,7 +89,7 @@ fn bindgen_test_layout_arp_ipv4() { unsafe { &(*(0 as *const arp_ipv4)).arp_sip as *const _ as usize }, 6usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(arp_ipv4), "::", stringify!(arp_sip) @@ -99,7 +99,7 @@ fn bindgen_test_layout_arp_ipv4() { unsafe { &(*(0 as *const arp_ipv4)).arp_tha as *const _ as usize }, 10usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(arp_ipv4), "::", stringify!(arp_tha) @@ -109,7 +109,7 @@ fn bindgen_test_layout_arp_ipv4() { unsafe { &(*(0 as *const arp_ipv4)).arp_tip as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(arp_ipv4), "::", stringify!(arp_tip) @@ -143,7 +143,7 @@ fn bindgen_test_layout_arp_hdr() { unsafe { &(*(0 as *const arp_hdr)).arp_hrd as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(arp_hdr), "::", stringify!(arp_hrd) @@ -153,7 +153,7 @@ fn bindgen_test_layout_arp_hdr() { unsafe { &(*(0 as *const arp_hdr)).arp_pro as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(arp_hdr), "::", stringify!(arp_pro) @@ -163,7 +163,7 @@ fn bindgen_test_layout_arp_hdr() { unsafe { &(*(0 as *const arp_hdr)).arp_hln as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(arp_hdr), "::", stringify!(arp_hln) @@ -173,7 +173,7 @@ fn bindgen_test_layout_arp_hdr() { unsafe { &(*(0 as *const arp_hdr)).arp_pln as *const _ as usize }, 5usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(arp_hdr), "::", stringify!(arp_pln) @@ -183,7 +183,7 @@ fn bindgen_test_layout_arp_hdr() { unsafe { &(*(0 as *const arp_hdr)).arp_op as *const _ as usize }, 6usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(arp_hdr), "::", stringify!(arp_op) @@ -193,7 +193,7 @@ fn bindgen_test_layout_arp_hdr() { unsafe { &(*(0 as *const arp_hdr)).arp_data as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(arp_hdr), "::", stringify!(arp_data) diff --git a/tests/expectations/tests/layout_array.rs b/tests/expectations/tests/layout_array.rs index 7dcd507a5b..c5d660787e 100644 --- a/tests/expectations/tests/layout_array.rs +++ b/tests/expectations/tests/layout_array.rs @@ -76,7 +76,7 @@ fn bindgen_test_layout_rte_mempool_ops() { unsafe { &(*(0 as *const rte_mempool_ops)).name as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mempool_ops), "::", stringify!(name) @@ -86,7 +86,7 @@ fn bindgen_test_layout_rte_mempool_ops() { unsafe { &(*(0 as *const rte_mempool_ops)).alloc as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mempool_ops), "::", stringify!(alloc) @@ -96,7 +96,7 @@ fn bindgen_test_layout_rte_mempool_ops() { unsafe { &(*(0 as *const rte_mempool_ops)).free as *const _ as usize }, 40usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mempool_ops), "::", stringify!(free) @@ -106,7 +106,7 @@ fn bindgen_test_layout_rte_mempool_ops() { unsafe { &(*(0 as *const rte_mempool_ops)).enqueue as *const _ as usize }, 48usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mempool_ops), "::", stringify!(enqueue) @@ -116,7 +116,7 @@ fn bindgen_test_layout_rte_mempool_ops() { unsafe { &(*(0 as *const rte_mempool_ops)).dequeue as *const _ as usize }, 56usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mempool_ops), "::", stringify!(dequeue) @@ -126,7 +126,7 @@ fn bindgen_test_layout_rte_mempool_ops() { unsafe { &(*(0 as *const rte_mempool_ops)).get_count as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mempool_ops), "::", stringify!(get_count) @@ -168,7 +168,7 @@ fn bindgen_test_layout_rte_spinlock_t() { unsafe { &(*(0 as *const rte_spinlock_t)).locked as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_spinlock_t), "::", stringify!(locked) @@ -204,7 +204,7 @@ fn bindgen_test_layout_rte_mempool_ops_table() { unsafe { &(*(0 as *const rte_mempool_ops_table)).sl as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mempool_ops_table), "::", stringify!(sl) @@ -214,7 +214,7 @@ fn bindgen_test_layout_rte_mempool_ops_table() { unsafe { &(*(0 as *const rte_mempool_ops_table)).num_ops as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mempool_ops_table), "::", stringify!(num_ops) @@ -224,7 +224,7 @@ fn bindgen_test_layout_rte_mempool_ops_table() { unsafe { &(*(0 as *const rte_mempool_ops_table)).ops as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mempool_ops_table), "::", stringify!(ops) @@ -266,7 +266,7 @@ fn bindgen_test_layout_malloc_heap__bindgen_ty_1() { unsafe { &(*(0 as *const malloc_heap__bindgen_ty_1)).lh_first as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(malloc_heap__bindgen_ty_1), "::", stringify!(lh_first) @@ -289,7 +289,7 @@ fn bindgen_test_layout_malloc_heap() { unsafe { &(*(0 as *const malloc_heap)).lock as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(malloc_heap), "::", stringify!(lock) @@ -299,7 +299,7 @@ fn bindgen_test_layout_malloc_heap() { unsafe { &(*(0 as *const malloc_heap)).free_head as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(malloc_heap), "::", stringify!(free_head) @@ -309,7 +309,7 @@ fn bindgen_test_layout_malloc_heap() { unsafe { &(*(0 as *const malloc_heap)).alloc_count as *const _ as usize }, 112usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(malloc_heap), "::", stringify!(alloc_count) @@ -319,7 +319,7 @@ fn bindgen_test_layout_malloc_heap() { unsafe { &(*(0 as *const malloc_heap)).total_size as *const _ as usize }, 120usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(malloc_heap), "::", stringify!(total_size) diff --git a/tests/expectations/tests/layout_array_too_long.rs b/tests/expectations/tests/layout_array_too_long.rs index 6c8ec85083..e8b2c748a8 100644 --- a/tests/expectations/tests/layout_array_too_long.rs +++ b/tests/expectations/tests/layout_array_too_long.rs @@ -45,7 +45,7 @@ fn bindgen_test_layout_ip_frag() { unsafe { &(*(0 as *const ip_frag)).ofs as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag), "::", stringify!(ofs) @@ -55,7 +55,7 @@ fn bindgen_test_layout_ip_frag() { unsafe { &(*(0 as *const ip_frag)).len as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag), "::", stringify!(len) @@ -65,7 +65,7 @@ fn bindgen_test_layout_ip_frag() { unsafe { &(*(0 as *const ip_frag)).mb as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag), "::", stringify!(mb) @@ -104,7 +104,7 @@ fn bindgen_test_layout_ip_frag_key() { unsafe { &(*(0 as *const ip_frag_key)).src_dst as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_key), "::", stringify!(src_dst) @@ -114,7 +114,7 @@ fn bindgen_test_layout_ip_frag_key() { unsafe { &(*(0 as *const ip_frag_key)).id as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_key), "::", stringify!(id) @@ -124,7 +124,7 @@ fn bindgen_test_layout_ip_frag_key() { unsafe { &(*(0 as *const ip_frag_key)).key_len as *const _ as usize }, 36usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_key), "::", stringify!(key_len) @@ -174,7 +174,7 @@ fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() { unsafe { &(*(0 as *const ip_frag_pkt__bindgen_ty_1)).tqe_next as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt__bindgen_ty_1), "::", stringify!(tqe_next) @@ -184,7 +184,7 @@ fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() { unsafe { &(*(0 as *const ip_frag_pkt__bindgen_ty_1)).tqe_prev as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt__bindgen_ty_1), "::", stringify!(tqe_prev) @@ -207,7 +207,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).lru as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(lru) @@ -217,7 +217,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).key as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(key) @@ -227,7 +227,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).start as *const _ as usize }, 56usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(start) @@ -237,7 +237,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).total_size as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(total_size) @@ -247,7 +247,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).frag_size as *const _ as usize }, 68usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(frag_size) @@ -257,7 +257,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).last_idx as *const _ as usize }, 72usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(last_idx) @@ -267,7 +267,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).frags as *const _ as usize }, 80usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(frags) diff --git a/tests/expectations/tests/layout_cmdline_token.rs b/tests/expectations/tests/layout_cmdline_token.rs index ca4147f013..3424329824 100644 --- a/tests/expectations/tests/layout_cmdline_token.rs +++ b/tests/expectations/tests/layout_cmdline_token.rs @@ -29,7 +29,7 @@ fn bindgen_test_layout_cmdline_token_hdr() { unsafe { &(*(0 as *const cmdline_token_hdr)).ops as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(cmdline_token_hdr), "::", stringify!(ops) @@ -39,7 +39,7 @@ fn bindgen_test_layout_cmdline_token_hdr() { unsafe { &(*(0 as *const cmdline_token_hdr)).offset as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(cmdline_token_hdr), "::", stringify!(offset) @@ -120,7 +120,7 @@ fn bindgen_test_layout_cmdline_token_ops() { unsafe { &(*(0 as *const cmdline_token_ops)).parse as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(cmdline_token_ops), "::", stringify!(parse) @@ -130,7 +130,7 @@ fn bindgen_test_layout_cmdline_token_ops() { unsafe { &(*(0 as *const cmdline_token_ops)).complete_get_nb as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(cmdline_token_ops), "::", stringify!(complete_get_nb) @@ -140,7 +140,7 @@ fn bindgen_test_layout_cmdline_token_ops() { unsafe { &(*(0 as *const cmdline_token_ops)).complete_get_elt as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(cmdline_token_ops), "::", stringify!(complete_get_elt) @@ -150,7 +150,7 @@ fn bindgen_test_layout_cmdline_token_ops() { unsafe { &(*(0 as *const cmdline_token_ops)).get_help as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(cmdline_token_ops), "::", stringify!(get_help) @@ -195,7 +195,7 @@ fn bindgen_test_layout_cmdline_token_num_data() { unsafe { &(*(0 as *const cmdline_token_num_data)).type_ as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(cmdline_token_num_data), "::", stringify!(type_) @@ -229,7 +229,7 @@ fn bindgen_test_layout_cmdline_token_num() { unsafe { &(*(0 as *const cmdline_token_num)).hdr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(cmdline_token_num), "::", stringify!(hdr) @@ -239,7 +239,7 @@ fn bindgen_test_layout_cmdline_token_num() { unsafe { &(*(0 as *const cmdline_token_num)).num_data as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(cmdline_token_num), "::", stringify!(num_data) diff --git a/tests/expectations/tests/layout_eth_conf.rs b/tests/expectations/tests/layout_eth_conf.rs index d5f1f1a540..b40239a388 100644 --- a/tests/expectations/tests/layout_eth_conf.rs +++ b/tests/expectations/tests/layout_eth_conf.rs @@ -78,7 +78,7 @@ fn bindgen_test_layout_rte_eth_rxmode() { unsafe { &(*(0 as *const rte_eth_rxmode)).mq_mode as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rxmode), "::", stringify!(mq_mode) @@ -88,7 +88,7 @@ fn bindgen_test_layout_rte_eth_rxmode() { unsafe { &(*(0 as *const rte_eth_rxmode)).max_rx_pkt_len as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rxmode), "::", stringify!(max_rx_pkt_len) @@ -98,7 +98,7 @@ fn bindgen_test_layout_rte_eth_rxmode() { unsafe { &(*(0 as *const rte_eth_rxmode)).split_hdr_size as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rxmode), "::", stringify!(split_hdr_size) @@ -494,7 +494,7 @@ fn bindgen_test_layout_rte_eth_txmode() { unsafe { &(*(0 as *const rte_eth_txmode)).mq_mode as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_txmode), "::", stringify!(mq_mode) @@ -504,7 +504,7 @@ fn bindgen_test_layout_rte_eth_txmode() { unsafe { &(*(0 as *const rte_eth_txmode)).pvid as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_txmode), "::", stringify!(pvid) @@ -677,7 +677,7 @@ fn bindgen_test_layout_rte_eth_rss_conf() { unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_key as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rss_conf), "::", stringify!(rss_key) @@ -687,7 +687,7 @@ fn bindgen_test_layout_rte_eth_rss_conf() { unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_key_len as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rss_conf), "::", stringify!(rss_key_len) @@ -697,7 +697,7 @@ fn bindgen_test_layout_rte_eth_rss_conf() { unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_hf as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rss_conf), "::", stringify!(rss_hf) @@ -780,7 +780,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1), "::", stringify!(vlan_id) @@ -790,7 +790,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf__bindgen_ty_1)).pools as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1), "::", stringify!(pools) @@ -813,7 +813,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).nb_queue_pools as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(nb_queue_pools) @@ -823,7 +823,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).enable_default_pool as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(enable_default_pool) @@ -833,7 +833,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).default_pool as *const _ as usize }, 5usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(default_pool) @@ -843,7 +843,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).nb_pool_maps as *const _ as usize }, 6usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(nb_pool_maps) @@ -853,7 +853,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).pool_map as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(pool_map) @@ -863,7 +863,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).dcb_tc as *const _ as usize }, 1032usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(dcb_tc) @@ -899,7 +899,7 @@ fn bindgen_test_layout_rte_eth_dcb_rx_conf() { unsafe { &(*(0 as *const rte_eth_dcb_rx_conf)).nb_tcs as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_dcb_rx_conf), "::", stringify!(nb_tcs) @@ -909,7 +909,7 @@ fn bindgen_test_layout_rte_eth_dcb_rx_conf() { unsafe { &(*(0 as *const rte_eth_dcb_rx_conf)).dcb_tc as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_dcb_rx_conf), "::", stringify!(dcb_tc) @@ -945,7 +945,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_tx_conf)).nb_queue_pools as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_tx_conf), "::", stringify!(nb_queue_pools) @@ -955,7 +955,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_tx_conf)).dcb_tc as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_tx_conf), "::", stringify!(dcb_tc) @@ -991,7 +991,7 @@ fn bindgen_test_layout_rte_eth_dcb_tx_conf() { unsafe { &(*(0 as *const rte_eth_dcb_tx_conf)).nb_tcs as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_dcb_tx_conf), "::", stringify!(nb_tcs) @@ -1001,7 +1001,7 @@ fn bindgen_test_layout_rte_eth_dcb_tx_conf() { unsafe { &(*(0 as *const rte_eth_dcb_tx_conf)).dcb_tc as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_dcb_tx_conf), "::", stringify!(dcb_tc) @@ -1035,7 +1035,7 @@ fn bindgen_test_layout_rte_eth_vmdq_tx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_tx_conf)).nb_queue_pools as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_tx_conf), "::", stringify!(nb_queue_pools) @@ -1094,7 +1094,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1), "::", stringify!(vlan_id) @@ -1104,7 +1104,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf__bindgen_ty_1)).pools as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1), "::", stringify!(pools) @@ -1127,7 +1127,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).nb_queue_pools as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(nb_queue_pools) @@ -1137,7 +1137,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).enable_default_pool as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(enable_default_pool) @@ -1147,7 +1147,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).default_pool as *const _ as usize }, 5usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(default_pool) @@ -1157,7 +1157,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).enable_loop_back as *const _ as usize }, 6usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(enable_loop_back) @@ -1167,7 +1167,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).nb_pool_maps as *const _ as usize }, 7usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(nb_pool_maps) @@ -1177,7 +1177,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).rx_mode as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(rx_mode) @@ -1187,7 +1187,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).pool_map as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(pool_map) @@ -1257,7 +1257,7 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { unsafe { &(*(0 as *const rte_eth_ipv4_flow)).src_ip as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv4_flow), "::", stringify!(src_ip) @@ -1267,7 +1267,7 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { unsafe { &(*(0 as *const rte_eth_ipv4_flow)).dst_ip as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv4_flow), "::", stringify!(dst_ip) @@ -1277,7 +1277,7 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { unsafe { &(*(0 as *const rte_eth_ipv4_flow)).tos as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv4_flow), "::", stringify!(tos) @@ -1287,7 +1287,7 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { unsafe { &(*(0 as *const rte_eth_ipv4_flow)).ttl as *const _ as usize }, 9usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv4_flow), "::", stringify!(ttl) @@ -1297,7 +1297,7 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { unsafe { &(*(0 as *const rte_eth_ipv4_flow)).proto as *const _ as usize }, 10usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv4_flow), "::", stringify!(proto) @@ -1335,7 +1335,7 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { unsafe { &(*(0 as *const rte_eth_ipv6_flow)).src_ip as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv6_flow), "::", stringify!(src_ip) @@ -1345,7 +1345,7 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { unsafe { &(*(0 as *const rte_eth_ipv6_flow)).dst_ip as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv6_flow), "::", stringify!(dst_ip) @@ -1355,7 +1355,7 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { unsafe { &(*(0 as *const rte_eth_ipv6_flow)).tc as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv6_flow), "::", stringify!(tc) @@ -1365,7 +1365,7 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { unsafe { &(*(0 as *const rte_eth_ipv6_flow)).proto as *const _ as usize }, 33usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv6_flow), "::", stringify!(proto) @@ -1375,7 +1375,7 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { unsafe { &(*(0 as *const rte_eth_ipv6_flow)).hop_limits as *const _ as usize }, 34usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv6_flow), "::", stringify!(hop_limits) @@ -1422,7 +1422,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).vlan_tci_mask as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(vlan_tci_mask) @@ -1432,7 +1432,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).ipv4_mask as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(ipv4_mask) @@ -1442,7 +1442,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).ipv6_mask as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(ipv6_mask) @@ -1452,7 +1452,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).src_port_mask as *const _ as usize }, 52usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(src_port_mask) @@ -1462,7 +1462,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).dst_port_mask as *const _ as usize }, 54usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(dst_port_mask) @@ -1472,7 +1472,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).mac_addr_byte_mask as *const _ as usize }, 56usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(mac_addr_byte_mask) @@ -1482,7 +1482,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).tunnel_id_mask as *const _ as usize }, 60usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(tunnel_id_mask) @@ -1492,7 +1492,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).tunnel_type_mask as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(tunnel_type_mask) @@ -1535,7 +1535,7 @@ fn bindgen_test_layout_rte_eth_flex_payload_cfg() { unsafe { &(*(0 as *const rte_eth_flex_payload_cfg)).type_ as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_flex_payload_cfg), "::", stringify!(type_) @@ -1545,7 +1545,7 @@ fn bindgen_test_layout_rte_eth_flex_payload_cfg() { unsafe { &(*(0 as *const rte_eth_flex_payload_cfg)).src_offset as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_flex_payload_cfg), "::", stringify!(src_offset) @@ -1581,7 +1581,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_mask() { unsafe { &(*(0 as *const rte_eth_fdir_flex_mask)).flow_type as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_mask), "::", stringify!(flow_type) @@ -1591,7 +1591,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_mask() { unsafe { &(*(0 as *const rte_eth_fdir_flex_mask)).mask as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_mask), "::", stringify!(mask) @@ -1626,7 +1626,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).nb_payloads as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_conf), "::", stringify!(nb_payloads) @@ -1636,7 +1636,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).nb_flexmasks as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_conf), "::", stringify!(nb_flexmasks) @@ -1646,7 +1646,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).flex_set as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_conf), "::", stringify!(flex_set) @@ -1656,7 +1656,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).flex_mask as *const _ as usize }, 292usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_conf), "::", stringify!(flex_mask) @@ -1702,7 +1702,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).mode as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(mode) @@ -1712,7 +1712,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).pballoc as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(pballoc) @@ -1722,7 +1722,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).status as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(status) @@ -1732,7 +1732,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).drop_queue as *const _ as usize }, 12usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(drop_queue) @@ -1742,7 +1742,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).mask as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(mask) @@ -1752,7 +1752,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).flex_conf as *const _ as usize }, 84usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(flex_conf) @@ -1789,7 +1789,7 @@ fn bindgen_test_layout_rte_intr_conf() { unsafe { &(*(0 as *const rte_intr_conf)).lsc as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_intr_conf), "::", stringify!(lsc) @@ -1799,7 +1799,7 @@ fn bindgen_test_layout_rte_intr_conf() { unsafe { &(*(0 as *const rte_intr_conf)).rxq as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_intr_conf), "::", stringify!(rxq) @@ -1867,7 +1867,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).rss_conf as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_1), "::", stringify!(rss_conf) @@ -1877,7 +1877,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).vmdq_dcb_conf as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_1), "::", stringify!(vmdq_dcb_conf) @@ -1887,7 +1887,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).dcb_rx_conf as *const _ as usize }, 1064usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_1), "::", stringify!(dcb_rx_conf) @@ -1897,7 +1897,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).vmdq_rx_conf as *const _ as usize }, 1080usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_1), "::", stringify!(vmdq_rx_conf) @@ -1935,7 +1935,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_2), "::", stringify!(vmdq_dcb_tx_conf) @@ -1945,7 +1945,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_2)).dcb_tx_conf as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_2), "::", stringify!(dcb_tx_conf) @@ -1955,7 +1955,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_2)).vmdq_tx_conf as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_2), "::", stringify!(vmdq_tx_conf) @@ -1983,7 +1983,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).link_speeds as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(link_speeds) @@ -1993,7 +1993,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).rxmode as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(rxmode) @@ -2003,7 +2003,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).txmode as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(txmode) @@ -2013,7 +2013,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).lpbk_mode as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(lpbk_mode) @@ -2023,7 +2023,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).rx_adv_conf as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(rx_adv_conf) @@ -2033,7 +2033,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).tx_adv_conf as *const _ as usize }, 2152usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(tx_adv_conf) @@ -2043,7 +2043,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).dcb_capability_en as *const _ as usize }, 2164usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(dcb_capability_en) @@ -2053,7 +2053,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).fdir_conf as *const _ as usize }, 2168usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(fdir_conf) @@ -2063,7 +2063,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).intr_conf as *const _ as usize }, 2940usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(intr_conf) diff --git a/tests/expectations/tests/layout_eth_conf_1_0.rs b/tests/expectations/tests/layout_eth_conf_1_0.rs index a35a9616ac..3995fb2218 100644 --- a/tests/expectations/tests/layout_eth_conf_1_0.rs +++ b/tests/expectations/tests/layout_eth_conf_1_0.rs @@ -121,7 +121,7 @@ fn bindgen_test_layout_rte_eth_rxmode() { unsafe { &(*(0 as *const rte_eth_rxmode)).mq_mode as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rxmode), "::", stringify!(mq_mode) @@ -131,7 +131,7 @@ fn bindgen_test_layout_rte_eth_rxmode() { unsafe { &(*(0 as *const rte_eth_rxmode)).max_rx_pkt_len as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rxmode), "::", stringify!(max_rx_pkt_len) @@ -141,7 +141,7 @@ fn bindgen_test_layout_rte_eth_rxmode() { unsafe { &(*(0 as *const rte_eth_rxmode)).split_hdr_size as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rxmode), "::", stringify!(split_hdr_size) @@ -542,7 +542,7 @@ fn bindgen_test_layout_rte_eth_txmode() { unsafe { &(*(0 as *const rte_eth_txmode)).mq_mode as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_txmode), "::", stringify!(mq_mode) @@ -552,7 +552,7 @@ fn bindgen_test_layout_rte_eth_txmode() { unsafe { &(*(0 as *const rte_eth_txmode)).pvid as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_txmode), "::", stringify!(pvid) @@ -730,7 +730,7 @@ fn bindgen_test_layout_rte_eth_rss_conf() { unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_key as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rss_conf), "::", stringify!(rss_key) @@ -740,7 +740,7 @@ fn bindgen_test_layout_rte_eth_rss_conf() { unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_key_len as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rss_conf), "::", stringify!(rss_key_len) @@ -750,7 +750,7 @@ fn bindgen_test_layout_rte_eth_rss_conf() { unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_hf as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_rss_conf), "::", stringify!(rss_hf) @@ -838,7 +838,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1), "::", stringify!(vlan_id) @@ -848,7 +848,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf__bindgen_ty_1)).pools as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1), "::", stringify!(pools) @@ -876,7 +876,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).nb_queue_pools as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(nb_queue_pools) @@ -886,7 +886,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).enable_default_pool as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(enable_default_pool) @@ -896,7 +896,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).default_pool as *const _ as usize }, 5usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(default_pool) @@ -906,7 +906,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).nb_pool_maps as *const _ as usize }, 6usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(nb_pool_maps) @@ -916,7 +916,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).pool_map as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(pool_map) @@ -926,7 +926,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).dcb_tc as *const _ as usize }, 1032usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_conf), "::", stringify!(dcb_tc) @@ -967,7 +967,7 @@ fn bindgen_test_layout_rte_eth_dcb_rx_conf() { unsafe { &(*(0 as *const rte_eth_dcb_rx_conf)).nb_tcs as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_dcb_rx_conf), "::", stringify!(nb_tcs) @@ -977,7 +977,7 @@ fn bindgen_test_layout_rte_eth_dcb_rx_conf() { unsafe { &(*(0 as *const rte_eth_dcb_rx_conf)).dcb_tc as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_dcb_rx_conf), "::", stringify!(dcb_tc) @@ -1018,7 +1018,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_tx_conf)).nb_queue_pools as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_tx_conf), "::", stringify!(nb_queue_pools) @@ -1028,7 +1028,7 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_dcb_tx_conf)).dcb_tc as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_dcb_tx_conf), "::", stringify!(dcb_tc) @@ -1069,7 +1069,7 @@ fn bindgen_test_layout_rte_eth_dcb_tx_conf() { unsafe { &(*(0 as *const rte_eth_dcb_tx_conf)).nb_tcs as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_dcb_tx_conf), "::", stringify!(nb_tcs) @@ -1079,7 +1079,7 @@ fn bindgen_test_layout_rte_eth_dcb_tx_conf() { unsafe { &(*(0 as *const rte_eth_dcb_tx_conf)).dcb_tc as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_dcb_tx_conf), "::", stringify!(dcb_tc) @@ -1118,7 +1118,7 @@ fn bindgen_test_layout_rte_eth_vmdq_tx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_tx_conf)).nb_queue_pools as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_tx_conf), "::", stringify!(nb_queue_pools) @@ -1182,7 +1182,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1), "::", stringify!(vlan_id) @@ -1192,7 +1192,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf__bindgen_ty_1)).pools as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1), "::", stringify!(pools) @@ -1220,7 +1220,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).nb_queue_pools as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(nb_queue_pools) @@ -1230,7 +1230,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).enable_default_pool as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(enable_default_pool) @@ -1240,7 +1240,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).default_pool as *const _ as usize }, 5usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(default_pool) @@ -1250,7 +1250,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).enable_loop_back as *const _ as usize }, 6usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(enable_loop_back) @@ -1260,7 +1260,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).nb_pool_maps as *const _ as usize }, 7usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(nb_pool_maps) @@ -1270,7 +1270,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).rx_mode as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(rx_mode) @@ -1280,7 +1280,7 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).pool_map as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_vmdq_rx_conf), "::", stringify!(pool_map) @@ -1355,7 +1355,7 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { unsafe { &(*(0 as *const rte_eth_ipv4_flow)).src_ip as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv4_flow), "::", stringify!(src_ip) @@ -1365,7 +1365,7 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { unsafe { &(*(0 as *const rte_eth_ipv4_flow)).dst_ip as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv4_flow), "::", stringify!(dst_ip) @@ -1375,7 +1375,7 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { unsafe { &(*(0 as *const rte_eth_ipv4_flow)).tos as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv4_flow), "::", stringify!(tos) @@ -1385,7 +1385,7 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { unsafe { &(*(0 as *const rte_eth_ipv4_flow)).ttl as *const _ as usize }, 9usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv4_flow), "::", stringify!(ttl) @@ -1395,7 +1395,7 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { unsafe { &(*(0 as *const rte_eth_ipv4_flow)).proto as *const _ as usize }, 10usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv4_flow), "::", stringify!(proto) @@ -1438,7 +1438,7 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { unsafe { &(*(0 as *const rte_eth_ipv6_flow)).src_ip as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv6_flow), "::", stringify!(src_ip) @@ -1448,7 +1448,7 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { unsafe { &(*(0 as *const rte_eth_ipv6_flow)).dst_ip as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv6_flow), "::", stringify!(dst_ip) @@ -1458,7 +1458,7 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { unsafe { &(*(0 as *const rte_eth_ipv6_flow)).tc as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv6_flow), "::", stringify!(tc) @@ -1468,7 +1468,7 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { unsafe { &(*(0 as *const rte_eth_ipv6_flow)).proto as *const _ as usize }, 33usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv6_flow), "::", stringify!(proto) @@ -1478,7 +1478,7 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { unsafe { &(*(0 as *const rte_eth_ipv6_flow)).hop_limits as *const _ as usize }, 34usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_ipv6_flow), "::", stringify!(hop_limits) @@ -1530,7 +1530,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).vlan_tci_mask as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(vlan_tci_mask) @@ -1540,7 +1540,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).ipv4_mask as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(ipv4_mask) @@ -1550,7 +1550,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).ipv6_mask as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(ipv6_mask) @@ -1560,7 +1560,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).src_port_mask as *const _ as usize }, 52usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(src_port_mask) @@ -1570,7 +1570,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).dst_port_mask as *const _ as usize }, 54usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(dst_port_mask) @@ -1580,7 +1580,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).mac_addr_byte_mask as *const _ as usize }, 56usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(mac_addr_byte_mask) @@ -1590,7 +1590,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).tunnel_id_mask as *const _ as usize }, 60usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(tunnel_id_mask) @@ -1600,7 +1600,7 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { unsafe { &(*(0 as *const rte_eth_fdir_masks)).tunnel_type_mask as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_masks), "::", stringify!(tunnel_type_mask) @@ -1648,7 +1648,7 @@ fn bindgen_test_layout_rte_eth_flex_payload_cfg() { unsafe { &(*(0 as *const rte_eth_flex_payload_cfg)).type_ as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_flex_payload_cfg), "::", stringify!(type_) @@ -1658,7 +1658,7 @@ fn bindgen_test_layout_rte_eth_flex_payload_cfg() { unsafe { &(*(0 as *const rte_eth_flex_payload_cfg)).src_offset as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_flex_payload_cfg), "::", stringify!(src_offset) @@ -1699,7 +1699,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_mask() { unsafe { &(*(0 as *const rte_eth_fdir_flex_mask)).flow_type as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_mask), "::", stringify!(flow_type) @@ -1709,7 +1709,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_mask() { unsafe { &(*(0 as *const rte_eth_fdir_flex_mask)).mask as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_mask), "::", stringify!(mask) @@ -1749,7 +1749,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).nb_payloads as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_conf), "::", stringify!(nb_payloads) @@ -1759,7 +1759,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).nb_flexmasks as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_conf), "::", stringify!(nb_flexmasks) @@ -1769,7 +1769,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).flex_set as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_conf), "::", stringify!(flex_set) @@ -1779,7 +1779,7 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).flex_mask as *const _ as usize }, 292usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_fdir_flex_conf), "::", stringify!(flex_mask) @@ -1830,7 +1830,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).mode as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(mode) @@ -1840,7 +1840,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).pballoc as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(pballoc) @@ -1850,7 +1850,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).status as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(status) @@ -1860,7 +1860,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).drop_queue as *const _ as usize }, 12usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(drop_queue) @@ -1870,7 +1870,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).mask as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(mask) @@ -1880,7 +1880,7 @@ fn bindgen_test_layout_rte_fdir_conf() { unsafe { &(*(0 as *const rte_fdir_conf)).flex_conf as *const _ as usize }, 84usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_fdir_conf), "::", stringify!(flex_conf) @@ -1922,7 +1922,7 @@ fn bindgen_test_layout_rte_intr_conf() { unsafe { &(*(0 as *const rte_intr_conf)).lsc as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_intr_conf), "::", stringify!(lsc) @@ -1932,7 +1932,7 @@ fn bindgen_test_layout_rte_intr_conf() { unsafe { &(*(0 as *const rte_intr_conf)).rxq as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_intr_conf), "::", stringify!(rxq) @@ -2005,7 +2005,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).rss_conf as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_1), "::", stringify!(rss_conf) @@ -2015,7 +2015,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).vmdq_dcb_conf as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_1), "::", stringify!(vmdq_dcb_conf) @@ -2025,7 +2025,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).dcb_rx_conf as *const _ as usize }, 1064usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_1), "::", stringify!(dcb_rx_conf) @@ -2035,7 +2035,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).vmdq_rx_conf as *const _ as usize }, 1080usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_1), "::", stringify!(vmdq_rx_conf) @@ -2078,7 +2078,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_2), "::", stringify!(vmdq_dcb_tx_conf) @@ -2088,7 +2088,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_2)).dcb_tx_conf as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_2), "::", stringify!(dcb_tx_conf) @@ -2098,7 +2098,7 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_2)).vmdq_tx_conf as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf__bindgen_ty_2), "::", stringify!(vmdq_tx_conf) @@ -2126,7 +2126,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).link_speeds as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(link_speeds) @@ -2136,7 +2136,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).rxmode as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(rxmode) @@ -2146,7 +2146,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).txmode as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(txmode) @@ -2156,7 +2156,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).lpbk_mode as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(lpbk_mode) @@ -2166,7 +2166,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).rx_adv_conf as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(rx_adv_conf) @@ -2176,7 +2176,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).tx_adv_conf as *const _ as usize }, 2152usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(tx_adv_conf) @@ -2186,7 +2186,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).dcb_capability_en as *const _ as usize }, 2164usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(dcb_capability_en) @@ -2196,7 +2196,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).fdir_conf as *const _ as usize }, 2168usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(fdir_conf) @@ -2206,7 +2206,7 @@ fn bindgen_test_layout_rte_eth_conf() { unsafe { &(*(0 as *const rte_eth_conf)).intr_conf as *const _ as usize }, 2940usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_eth_conf), "::", stringify!(intr_conf) diff --git a/tests/expectations/tests/layout_kni_mbuf.rs b/tests/expectations/tests/layout_kni_mbuf.rs index e848c52e06..7d1efa176e 100644 --- a/tests/expectations/tests/layout_kni_mbuf.rs +++ b/tests/expectations/tests/layout_kni_mbuf.rs @@ -42,7 +42,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).buf_addr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(buf_addr) @@ -52,7 +52,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).buf_physaddr as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(buf_physaddr) @@ -62,7 +62,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).pad0 as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(pad0) @@ -72,7 +72,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).data_off as *const _ as usize }, 18usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(data_off) @@ -82,7 +82,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).pad1 as *const _ as usize }, 20usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(pad1) @@ -92,7 +92,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).nb_segs as *const _ as usize }, 22usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(nb_segs) @@ -102,7 +102,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).pad4 as *const _ as usize }, 23usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(pad4) @@ -112,7 +112,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).ol_flags as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(ol_flags) @@ -122,7 +122,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).pad2 as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(pad2) @@ -132,7 +132,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).pkt_len as *const _ as usize }, 36usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(pkt_len) @@ -142,7 +142,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).data_len as *const _ as usize }, 40usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(data_len) @@ -152,7 +152,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).pad3 as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(pad3) @@ -162,7 +162,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).pool as *const _ as usize }, 72usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(pool) @@ -172,7 +172,7 @@ fn bindgen_test_layout_rte_kni_mbuf() { unsafe { &(*(0 as *const rte_kni_mbuf)).next as *const _ as usize }, 80usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_kni_mbuf), "::", stringify!(next) diff --git a/tests/expectations/tests/layout_large_align_field.rs b/tests/expectations/tests/layout_large_align_field.rs index 24034d9270..a7e455a9b6 100644 --- a/tests/expectations/tests/layout_large_align_field.rs +++ b/tests/expectations/tests/layout_large_align_field.rs @@ -82,7 +82,7 @@ fn bindgen_test_layout_ip_frag() { unsafe { &(*(0 as *const ip_frag)).ofs as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag), "::", stringify!(ofs) @@ -92,7 +92,7 @@ fn bindgen_test_layout_ip_frag() { unsafe { &(*(0 as *const ip_frag)).len as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag), "::", stringify!(len) @@ -102,7 +102,7 @@ fn bindgen_test_layout_ip_frag() { unsafe { &(*(0 as *const ip_frag)).mb as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag), "::", stringify!(mb) @@ -141,7 +141,7 @@ fn bindgen_test_layout_ip_frag_key() { unsafe { &(*(0 as *const ip_frag_key)).src_dst as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_key), "::", stringify!(src_dst) @@ -151,7 +151,7 @@ fn bindgen_test_layout_ip_frag_key() { unsafe { &(*(0 as *const ip_frag_key)).id as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_key), "::", stringify!(id) @@ -161,7 +161,7 @@ fn bindgen_test_layout_ip_frag_key() { unsafe { &(*(0 as *const ip_frag_key)).key_len as *const _ as usize }, 36usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_key), "::", stringify!(key_len) @@ -211,7 +211,7 @@ fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() { unsafe { &(*(0 as *const ip_frag_pkt__bindgen_ty_1)).tqe_next as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt__bindgen_ty_1), "::", stringify!(tqe_next) @@ -221,7 +221,7 @@ fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() { unsafe { &(*(0 as *const ip_frag_pkt__bindgen_ty_1)).tqe_prev as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt__bindgen_ty_1), "::", stringify!(tqe_prev) @@ -244,7 +244,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).lru as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(lru) @@ -254,7 +254,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).key as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(key) @@ -264,7 +264,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).start as *const _ as usize }, 56usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(start) @@ -274,7 +274,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).total_size as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(total_size) @@ -284,7 +284,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).frag_size as *const _ as usize }, 68usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(frag_size) @@ -294,7 +294,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).last_idx as *const _ as usize }, 72usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(last_idx) @@ -304,7 +304,7 @@ fn bindgen_test_layout_ip_frag_pkt() { unsafe { &(*(0 as *const ip_frag_pkt)).frags as *const _ as usize }, 80usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_pkt), "::", stringify!(frags) @@ -338,7 +338,7 @@ fn bindgen_test_layout_ip_pkt_list() { unsafe { &(*(0 as *const ip_pkt_list)).tqh_first as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_pkt_list), "::", stringify!(tqh_first) @@ -348,7 +348,7 @@ fn bindgen_test_layout_ip_pkt_list() { unsafe { &(*(0 as *const ip_pkt_list)).tqh_last as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_pkt_list), "::", stringify!(tqh_last) @@ -389,7 +389,7 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { unsafe { &(*(0 as *const ip_frag_tbl_stat)).find_num as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_tbl_stat), "::", stringify!(find_num) @@ -399,7 +399,7 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { unsafe { &(*(0 as *const ip_frag_tbl_stat)).add_num as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_tbl_stat), "::", stringify!(add_num) @@ -409,7 +409,7 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { unsafe { &(*(0 as *const ip_frag_tbl_stat)).del_num as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_tbl_stat), "::", stringify!(del_num) @@ -419,7 +419,7 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { unsafe { &(*(0 as *const ip_frag_tbl_stat)).reuse_num as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_tbl_stat), "::", stringify!(reuse_num) @@ -429,7 +429,7 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { unsafe { &(*(0 as *const ip_frag_tbl_stat)).fail_total as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_tbl_stat), "::", stringify!(fail_total) @@ -439,7 +439,7 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { unsafe { &(*(0 as *const ip_frag_tbl_stat)).fail_nospace as *const _ as usize }, 40usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ip_frag_tbl_stat), "::", stringify!(fail_nospace) @@ -489,7 +489,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).max_cycles as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(max_cycles) @@ -499,7 +499,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).entry_mask as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(entry_mask) @@ -509,7 +509,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).max_entries as *const _ as usize }, 12usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(max_entries) @@ -519,7 +519,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).use_entries as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(use_entries) @@ -529,7 +529,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).bucket_entries as *const _ as usize }, 20usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(bucket_entries) @@ -539,7 +539,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).nb_entries as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(nb_entries) @@ -549,7 +549,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).nb_buckets as *const _ as usize }, 28usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(nb_buckets) @@ -559,7 +559,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).last as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(last) @@ -569,7 +569,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).lru as *const _ as usize }, 40usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(lru) @@ -579,7 +579,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).stat as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(stat) @@ -589,7 +589,7 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { unsafe { &(*(0 as *const rte_ip_frag_tbl)).pkt as *const _ as usize }, 128usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_ip_frag_tbl), "::", stringify!(pkt) diff --git a/tests/expectations/tests/layout_mbuf.rs b/tests/expectations/tests/layout_mbuf.rs index 1db17172dc..05ee028f74 100644 --- a/tests/expectations/tests/layout_mbuf.rs +++ b/tests/expectations/tests/layout_mbuf.rs @@ -33,7 +33,7 @@ fn bindgen_test_layout_rte_atomic16_t() { unsafe { &(*(0 as *const rte_atomic16_t)).cnt as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_atomic16_t), "::", stringify!(cnt) @@ -118,7 +118,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_1)).refcnt_atomic as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_1), "::", stringify!(refcnt_atomic) @@ -128,7 +128,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_1)).refcnt as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_1), "::", stringify!(refcnt) @@ -461,7 +461,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_2() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_2)).packet_type as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_2), "::", stringify!(packet_type) @@ -530,7 +530,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindg }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), "::", stringify!(hash) @@ -543,7 +543,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindg }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), "::", stringify!(id) @@ -575,7 +575,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1), "::", stringify!(lo) @@ -609,7 +609,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_1)).hi as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1), "::", stringify!(hi) @@ -649,7 +649,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_2)).lo as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2), "::", stringify!(lo) @@ -659,7 +659,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_2)).hi as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2), "::", stringify!(hi) @@ -682,7 +682,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).rss as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3), "::", stringify!(rss) @@ -692,7 +692,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).fdir as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3), "::", stringify!(fdir) @@ -702,7 +702,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).sched as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3), "::", stringify!(sched) @@ -712,7 +712,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).usr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3), "::", stringify!(usr) @@ -749,7 +749,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_4)).userdata as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_4), "::", stringify!(userdata) @@ -759,7 +759,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_4)).udata64 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_4), "::", stringify!(udata64) @@ -1054,7 +1054,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_5() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_5)).tx_offload as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_5), "::", stringify!(tx_offload) @@ -1077,7 +1077,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).cacheline0 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(cacheline0) @@ -1087,7 +1087,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).buf_addr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(buf_addr) @@ -1097,7 +1097,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).buf_physaddr as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(buf_physaddr) @@ -1107,7 +1107,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).buf_len as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(buf_len) @@ -1117,7 +1117,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).rearm_data as *const _ as usize }, 18usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(rearm_data) @@ -1127,7 +1127,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).data_off as *const _ as usize }, 18usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(data_off) @@ -1137,7 +1137,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).nb_segs as *const _ as usize }, 22usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(nb_segs) @@ -1147,7 +1147,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).port as *const _ as usize }, 23usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(port) @@ -1157,7 +1157,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).ol_flags as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(ol_flags) @@ -1167,7 +1167,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).rx_descriptor_fields1 as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(rx_descriptor_fields1) @@ -1177,7 +1177,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).pkt_len as *const _ as usize }, 36usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(pkt_len) @@ -1187,7 +1187,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).data_len as *const _ as usize }, 40usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(data_len) @@ -1197,7 +1197,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).vlan_tci as *const _ as usize }, 42usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(vlan_tci) @@ -1207,7 +1207,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).hash as *const _ as usize }, 44usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(hash) @@ -1217,7 +1217,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).seqn as *const _ as usize }, 52usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(seqn) @@ -1227,7 +1227,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).vlan_tci_outer as *const _ as usize }, 56usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(vlan_tci_outer) @@ -1237,7 +1237,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).cacheline1 as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(cacheline1) @@ -1247,7 +1247,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).pool as *const _ as usize }, 72usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(pool) @@ -1257,7 +1257,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).next as *const _ as usize }, 80usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(next) @@ -1267,7 +1267,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).priv_size as *const _ as usize }, 96usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(priv_size) @@ -1277,7 +1277,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).timesync as *const _ as usize }, 98usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(timesync) diff --git a/tests/expectations/tests/layout_mbuf_1_0.rs b/tests/expectations/tests/layout_mbuf_1_0.rs index 256c839504..aa726742d1 100644 --- a/tests/expectations/tests/layout_mbuf_1_0.rs +++ b/tests/expectations/tests/layout_mbuf_1_0.rs @@ -76,7 +76,7 @@ fn bindgen_test_layout_rte_atomic16_t() { unsafe { &(*(0 as *const rte_atomic16_t)).cnt as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_atomic16_t), "::", stringify!(cnt) @@ -166,7 +166,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_1)).refcnt_atomic as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_1), "::", stringify!(refcnt_atomic) @@ -176,7 +176,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_1)).refcnt as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_1), "::", stringify!(refcnt) @@ -514,7 +514,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_2() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_2)).packet_type as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_2), "::", stringify!(packet_type) @@ -584,7 +584,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindg }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), "::", stringify!(hash) @@ -597,7 +597,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindg }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), "::", stringify!(id) @@ -634,7 +634,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1), "::", stringify!(lo) @@ -668,7 +668,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_1)).hi as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1), "::", stringify!(hi) @@ -708,7 +708,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_2)).lo as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2), "::", stringify!(lo) @@ -718,7 +718,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_2)).hi as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2), "::", stringify!(hi) @@ -746,7 +746,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).rss as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3), "::", stringify!(rss) @@ -756,7 +756,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).fdir as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3), "::", stringify!(fdir) @@ -766,7 +766,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).sched as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3), "::", stringify!(sched) @@ -776,7 +776,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).usr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_3), "::", stringify!(usr) @@ -813,7 +813,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_4)).userdata as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_4), "::", stringify!(userdata) @@ -823,7 +823,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_4)).udata64 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_4), "::", stringify!(udata64) @@ -1123,7 +1123,7 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_5() { unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_5)).tx_offload as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf__bindgen_ty_5), "::", stringify!(tx_offload) @@ -1146,7 +1146,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).cacheline0 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(cacheline0) @@ -1156,7 +1156,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).buf_addr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(buf_addr) @@ -1166,7 +1166,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).buf_physaddr as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(buf_physaddr) @@ -1176,7 +1176,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).buf_len as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(buf_len) @@ -1186,7 +1186,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).rearm_data as *const _ as usize }, 18usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(rearm_data) @@ -1196,7 +1196,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).data_off as *const _ as usize }, 18usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(data_off) @@ -1206,7 +1206,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).nb_segs as *const _ as usize }, 22usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(nb_segs) @@ -1216,7 +1216,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).port as *const _ as usize }, 23usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(port) @@ -1226,7 +1226,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).ol_flags as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(ol_flags) @@ -1236,7 +1236,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).rx_descriptor_fields1 as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(rx_descriptor_fields1) @@ -1246,7 +1246,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).pkt_len as *const _ as usize }, 36usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(pkt_len) @@ -1256,7 +1256,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).data_len as *const _ as usize }, 40usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(data_len) @@ -1266,7 +1266,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).vlan_tci as *const _ as usize }, 42usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(vlan_tci) @@ -1276,7 +1276,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).hash as *const _ as usize }, 44usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(hash) @@ -1286,7 +1286,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).seqn as *const _ as usize }, 52usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(seqn) @@ -1296,7 +1296,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).vlan_tci_outer as *const _ as usize }, 56usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(vlan_tci_outer) @@ -1306,7 +1306,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).cacheline1 as *const _ as usize }, 64usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(cacheline1) @@ -1316,7 +1316,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).pool as *const _ as usize }, 72usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(pool) @@ -1326,7 +1326,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).next as *const _ as usize }, 80usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(next) @@ -1336,7 +1336,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).priv_size as *const _ as usize }, 96usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(priv_size) @@ -1346,7 +1346,7 @@ fn bindgen_test_layout_rte_mbuf() { unsafe { &(*(0 as *const rte_mbuf)).timesync as *const _ as usize }, 98usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(rte_mbuf), "::", stringify!(timesync) diff --git a/tests/expectations/tests/libclang-3.8/call-conv-field.rs b/tests/expectations/tests/libclang-3.8/call-conv-field.rs index b7d5128303..3e3f55a3bc 100644 --- a/tests/expectations/tests/libclang-3.8/call-conv-field.rs +++ b/tests/expectations/tests/libclang-3.8/call-conv-field.rs @@ -29,7 +29,7 @@ fn bindgen_test_layout_JNINativeInterface_() { unsafe { &(*(0 as *const JNINativeInterface_)).GetVersion as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(JNINativeInterface_), "::", stringify!(GetVersion) @@ -39,7 +39,7 @@ fn bindgen_test_layout_JNINativeInterface_() { unsafe { &(*(0 as *const JNINativeInterface_)).__hack as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(JNINativeInterface_), "::", stringify!(__hack) diff --git a/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs index 7b13bb7c33..387fe7a84f 100644 --- a/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs +++ b/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_Rooted() { unsafe { &(*(0 as *const Rooted)).ptr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Rooted), "::", stringify!(ptr) diff --git a/tests/expectations/tests/libclang-3.9/call-conv-field.rs b/tests/expectations/tests/libclang-3.9/call-conv-field.rs index a3c6fe6214..dee437607f 100644 --- a/tests/expectations/tests/libclang-3.9/call-conv-field.rs +++ b/tests/expectations/tests/libclang-3.9/call-conv-field.rs @@ -29,7 +29,7 @@ fn bindgen_test_layout_JNINativeInterface_() { unsafe { &(*(0 as *const JNINativeInterface_)).GetVersion as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(JNINativeInterface_), "::", stringify!(GetVersion) @@ -39,7 +39,7 @@ fn bindgen_test_layout_JNINativeInterface_() { unsafe { &(*(0 as *const JNINativeInterface_)).__hack as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(JNINativeInterface_), "::", stringify!(__hack) diff --git a/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs index 7b13bb7c33..387fe7a84f 100644 --- a/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs +++ b/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_Rooted() { unsafe { &(*(0 as *const Rooted)).ptr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Rooted), "::", stringify!(ptr) diff --git a/tests/expectations/tests/libclang-4/call-conv-field.rs b/tests/expectations/tests/libclang-4/call-conv-field.rs index a3c6fe6214..dee437607f 100644 --- a/tests/expectations/tests/libclang-4/call-conv-field.rs +++ b/tests/expectations/tests/libclang-4/call-conv-field.rs @@ -29,7 +29,7 @@ fn bindgen_test_layout_JNINativeInterface_() { unsafe { &(*(0 as *const JNINativeInterface_)).GetVersion as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(JNINativeInterface_), "::", stringify!(GetVersion) @@ -39,7 +39,7 @@ fn bindgen_test_layout_JNINativeInterface_() { unsafe { &(*(0 as *const JNINativeInterface_)).__hack as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(JNINativeInterface_), "::", stringify!(__hack) diff --git a/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs index e0b8616d89..85d76b75d4 100644 --- a/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs +++ b/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_Rooted() { unsafe { &(*(0 as *const Rooted)).ptr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Rooted), "::", stringify!(ptr) diff --git a/tests/expectations/tests/msvc-no-usr.rs b/tests/expectations/tests/msvc-no-usr.rs index dfa378248e..ca079531b4 100644 --- a/tests/expectations/tests/msvc-no-usr.rs +++ b/tests/expectations/tests/msvc-no-usr.rs @@ -24,6 +24,6 @@ fn bindgen_test_layout_A() { assert_eq!( unsafe { &(*(0 as *const A)).foo as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(A), "::", stringify!(foo)) + concat!("Offset of field: ", stringify!(A), "::", stringify!(foo)) ); } diff --git a/tests/expectations/tests/mutable.rs b/tests/expectations/tests/mutable.rs index 7e841f7bd3..50cfbadc62 100644 --- a/tests/expectations/tests/mutable.rs +++ b/tests/expectations/tests/mutable.rs @@ -26,7 +26,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).m_member as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(m_member) @@ -36,7 +36,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).m_other as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(m_other) @@ -64,7 +64,7 @@ fn bindgen_test_layout_NonCopiable() { unsafe { &(*(0 as *const NonCopiable)).m_member as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(NonCopiable), "::", stringify!(m_member) @@ -100,7 +100,7 @@ fn bindgen_test_layout_NonCopiableWithNonCopiableMutableMember() { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(NonCopiableWithNonCopiableMutableMember), "::", stringify!(m_member) diff --git a/tests/expectations/tests/namespace.rs b/tests/expectations/tests/namespace.rs index 13a9df0e78..c57764fb9e 100644 --- a/tests/expectations/tests/namespace.rs +++ b/tests/expectations/tests/namespace.rs @@ -48,7 +48,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const A)).b as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(A), "::", stringify!(b)) + concat!("Offset of field: ", stringify!(A), "::", stringify!(b)) ); } extern "C" { diff --git a/tests/expectations/tests/nested.rs b/tests/expectations/tests/nested.rs index 336723bbf0..9e8424d0c5 100644 --- a/tests/expectations/tests/nested.rs +++ b/tests/expectations/tests/nested.rs @@ -24,12 +24,7 @@ fn bindgen_test_layout_Calc() { assert_eq!( unsafe { &(*(0 as *const Calc)).w as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Calc), - "::", - stringify!(w) - ) + concat!("Offset of field: ", stringify!(Calc), "::", stringify!(w)) ); } #[repr(C)] @@ -77,7 +72,7 @@ fn bindgen_test_layout_Test_Size() { unsafe { &(*(0 as *const Test_Size)).mWidth as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test_Size), "::", stringify!(mWidth) @@ -87,7 +82,7 @@ fn bindgen_test_layout_Test_Size() { unsafe { &(*(0 as *const Test_Size)).mHeight as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test_Size), "::", stringify!(mHeight) diff --git a/tests/expectations/tests/nested_within_namespace.rs b/tests/expectations/tests/nested_within_namespace.rs index 0a494ba2e7..390d93396d 100644 --- a/tests/expectations/tests/nested_within_namespace.rs +++ b/tests/expectations/tests/nested_within_namespace.rs @@ -37,7 +37,7 @@ pub mod root { unsafe { &(*(0 as *const Bar_Baz)).foo as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Bar_Baz), "::", stringify!(foo) @@ -59,12 +59,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const Bar)).foo as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(foo) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(foo)) ); } #[repr(C)] @@ -87,12 +82,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const Baz)).baz as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Baz), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(Baz), "::", stringify!(baz)) ); } } diff --git a/tests/expectations/tests/no-comments.rs b/tests/expectations/tests/no-comments.rs index 0260e54861..2c7144dd9f 100644 --- a/tests/expectations/tests/no-comments.rs +++ b/tests/expectations/tests/no-comments.rs @@ -24,6 +24,6 @@ fn bindgen_test_layout_Foo() { assert_eq!( unsafe { &(*(0 as *const Foo)).s as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(Foo), "::", stringify!(s)) + concat!("Offset of field: ", stringify!(Foo), "::", stringify!(s)) ); } diff --git a/tests/expectations/tests/no-derive-debug.rs b/tests/expectations/tests/no-derive-debug.rs index a36b624723..309b79d448 100644 --- a/tests/expectations/tests/no-derive-debug.rs +++ b/tests/expectations/tests/no-derive-debug.rs @@ -33,22 +33,12 @@ fn bindgen_test_layout_bar() { assert_eq!( unsafe { &(*(0 as *const bar)).foo as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(bar), - "::", - stringify!(foo) - ) + concat!("Offset of field: ", stringify!(bar), "::", stringify!(foo)) ); assert_eq!( unsafe { &(*(0 as *const bar)).baz as *const _ as usize }, 4usize, - concat!( - "Alignment of field: ", - stringify!(bar), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(bar), "::", stringify!(baz)) ); } impl Default for bar { diff --git a/tests/expectations/tests/no-derive-default.rs b/tests/expectations/tests/no-derive-default.rs index 8c290e381a..5e8ca7e64e 100644 --- a/tests/expectations/tests/no-derive-default.rs +++ b/tests/expectations/tests/no-derive-default.rs @@ -33,21 +33,11 @@ fn bindgen_test_layout_bar() { assert_eq!( unsafe { &(*(0 as *const bar)).foo as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(bar), - "::", - stringify!(foo) - ) + concat!("Offset of field: ", stringify!(bar), "::", stringify!(foo)) ); assert_eq!( unsafe { &(*(0 as *const bar)).baz as *const _ as usize }, 4usize, - concat!( - "Alignment of field: ", - stringify!(bar), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(bar), "::", stringify!(baz)) ); } diff --git a/tests/expectations/tests/no-hash-whitelisted.rs b/tests/expectations/tests/no-hash-whitelisted.rs index 9997d06279..4a6c92c8a1 100644 --- a/tests/expectations/tests/no-hash-whitelisted.rs +++ b/tests/expectations/tests/no-hash-whitelisted.rs @@ -24,11 +24,6 @@ fn bindgen_test_layout_NoHash() { assert_eq!( unsafe { &(*(0 as *const NoHash)).i as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(NoHash), - "::", - stringify!(i) - ) + concat!("Offset of field: ", stringify!(NoHash), "::", stringify!(i)) ); } diff --git a/tests/expectations/tests/no-partialeq-whitelisted.rs b/tests/expectations/tests/no-partialeq-whitelisted.rs index fb1437f1fe..388686cc05 100644 --- a/tests/expectations/tests/no-partialeq-whitelisted.rs +++ b/tests/expectations/tests/no-partialeq-whitelisted.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_NoPartialEq() { unsafe { &(*(0 as *const NoPartialEq)).i as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(NoPartialEq), "::", stringify!(i) diff --git a/tests/expectations/tests/no-recursive-whitelisting.rs b/tests/expectations/tests/no-recursive-whitelisting.rs index 3901339a98..a1494ce905 100644 --- a/tests/expectations/tests/no-recursive-whitelisting.rs +++ b/tests/expectations/tests/no-recursive-whitelisting.rs @@ -24,12 +24,7 @@ fn bindgen_test_layout_Foo() { assert_eq!( unsafe { &(*(0 as *const Foo)).baz as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Foo), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(Foo), "::", stringify!(baz)) ); } impl Default for Foo { diff --git a/tests/expectations/tests/no-std.rs b/tests/expectations/tests/no-std.rs index 2708b21cfa..b8ba74f439 100644 --- a/tests/expectations/tests/no-std.rs +++ b/tests/expectations/tests/no-std.rs @@ -30,22 +30,17 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset 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)) + concat!("Offset 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) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } impl Default for foo { diff --git a/tests/expectations/tests/no_copy_whitelisted.rs b/tests/expectations/tests/no_copy_whitelisted.rs index 7921962550..2dcb1601df 100644 --- a/tests/expectations/tests/no_copy_whitelisted.rs +++ b/tests/expectations/tests/no_copy_whitelisted.rs @@ -24,11 +24,6 @@ fn bindgen_test_layout_NoCopy() { assert_eq!( unsafe { &(*(0 as *const NoCopy)).i as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(NoCopy), - "::", - stringify!(i) - ) + concat!("Offset of field: ", stringify!(NoCopy), "::", stringify!(i)) ); } diff --git a/tests/expectations/tests/non-type-params.rs b/tests/expectations/tests/non-type-params.rs index c20876dcd1..c0ee909543 100644 --- a/tests/expectations/tests/non-type-params.rs +++ b/tests/expectations/tests/non-type-params.rs @@ -29,7 +29,7 @@ fn bindgen_test_layout_UsesArray() { unsafe { &(*(0 as *const UsesArray)).array_char_16 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(UsesArray), "::", stringify!(array_char_16) @@ -39,7 +39,7 @@ fn bindgen_test_layout_UsesArray() { unsafe { &(*(0 as *const UsesArray)).array_bool_8 as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(UsesArray), "::", stringify!(array_bool_8) @@ -49,7 +49,7 @@ fn bindgen_test_layout_UsesArray() { unsafe { &(*(0 as *const UsesArray)).array_int_4 as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(UsesArray), "::", stringify!(array_int_4) diff --git a/tests/expectations/tests/objc_interface_type.rs b/tests/expectations/tests/objc_interface_type.rs index 52cad57d53..7e16ed8069 100644 --- a/tests/expectations/tests/objc_interface_type.rs +++ b/tests/expectations/tests/objc_interface_type.rs @@ -31,7 +31,7 @@ fn bindgen_test_layout_FooStruct() { unsafe { &(*(0 as *const FooStruct)).foo as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(FooStruct), "::", stringify!(foo) diff --git a/tests/expectations/tests/opaque-template-inst-member-2.rs b/tests/expectations/tests/opaque-template-inst-member-2.rs index 3e00e0edf7..0ccf282e86 100644 --- a/tests/expectations/tests/opaque-template-inst-member-2.rs +++ b/tests/expectations/tests/opaque-template-inst-member-2.rs @@ -35,7 +35,7 @@ fn bindgen_test_layout_ContainsOpaqueTemplate() { unsafe { &(*(0 as *const ContainsOpaqueTemplate)).mBlah as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContainsOpaqueTemplate), "::", stringify!(mBlah) @@ -45,7 +45,7 @@ fn bindgen_test_layout_ContainsOpaqueTemplate() { unsafe { &(*(0 as *const ContainsOpaqueTemplate)).mBaz as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContainsOpaqueTemplate), "::", stringify!(mBaz) @@ -75,7 +75,7 @@ fn bindgen_test_layout_InheritsOpaqueTemplate() { unsafe { &(*(0 as *const InheritsOpaqueTemplate)).wow as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(InheritsOpaqueTemplate), "::", stringify!(wow) diff --git a/tests/expectations/tests/opaque-template-inst-member.rs b/tests/expectations/tests/opaque-template-inst-member.rs index 60c6d846e1..26f85657f1 100644 --- a/tests/expectations/tests/opaque-template-inst-member.rs +++ b/tests/expectations/tests/opaque-template-inst-member.rs @@ -32,7 +32,7 @@ fn bindgen_test_layout_ContainsOpaqueTemplate() { unsafe { &(*(0 as *const ContainsOpaqueTemplate)).mBlah as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContainsOpaqueTemplate), "::", stringify!(mBlah) @@ -42,7 +42,7 @@ fn bindgen_test_layout_ContainsOpaqueTemplate() { unsafe { &(*(0 as *const ContainsOpaqueTemplate)).mBaz as *const _ as usize }, 404usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContainsOpaqueTemplate), "::", stringify!(mBaz) @@ -82,7 +82,7 @@ fn bindgen_test_layout_InheritsOpaqueTemplate() { unsafe { &(*(0 as *const InheritsOpaqueTemplate)).wow as *const _ as usize }, 408usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(InheritsOpaqueTemplate), "::", stringify!(wow) diff --git a/tests/expectations/tests/opaque-template-instantiation-namespaced.rs b/tests/expectations/tests/opaque-template-instantiation-namespaced.rs index 45d8a7d826..d22d74c642 100644 --- a/tests/expectations/tests/opaque-template-instantiation-namespaced.rs +++ b/tests/expectations/tests/opaque-template-instantiation-namespaced.rs @@ -42,7 +42,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const Foo)).c as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(Foo), "::", stringify!(c)) + concat!("Offset of field: ", stringify!(Foo), "::", stringify!(c)) ); } #[repr(C)] @@ -65,7 +65,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const Bar)).i as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(Bar), "::", stringify!(i)) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(i)) ); } #[repr(C)] @@ -89,7 +89,7 @@ pub mod root { unsafe { &(*(0 as *const ContainsInstantiation)).not_opaque as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContainsInstantiation), "::", stringify!(not_opaque) @@ -124,7 +124,7 @@ pub mod root { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContainsOpaqueInstantiation), "::", stringify!(opaque) diff --git a/tests/expectations/tests/opaque-template-instantiation.rs b/tests/expectations/tests/opaque-template-instantiation.rs index 02788d769c..8fbe33ae49 100644 --- a/tests/expectations/tests/opaque-template-instantiation.rs +++ b/tests/expectations/tests/opaque-template-instantiation.rs @@ -36,7 +36,7 @@ fn bindgen_test_layout_ContainsInstantiation() { unsafe { &(*(0 as *const ContainsInstantiation)).not_opaque as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContainsInstantiation), "::", stringify!(not_opaque) @@ -69,7 +69,7 @@ fn bindgen_test_layout_ContainsOpaqueInstantiation() { unsafe { &(*(0 as *const ContainsOpaqueInstantiation)).opaque as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContainsOpaqueInstantiation), "::", stringify!(opaque) diff --git a/tests/expectations/tests/opaque_in_struct.rs b/tests/expectations/tests/opaque_in_struct.rs index 92d28e4d03..e61a7005d9 100644 --- a/tests/expectations/tests/opaque_in_struct.rs +++ b/tests/expectations/tests/opaque_in_struct.rs @@ -45,7 +45,7 @@ fn bindgen_test_layout_container() { unsafe { &(*(0 as *const container)).contained as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(container), "::", stringify!(contained) diff --git a/tests/expectations/tests/opaque_pointer.rs b/tests/expectations/tests/opaque_pointer.rs index 6543c7c2d9..c8bbcea6d6 100644 --- a/tests/expectations/tests/opaque_pointer.rs +++ b/tests/expectations/tests/opaque_pointer.rs @@ -53,7 +53,7 @@ fn bindgen_test_layout_WithOpaquePtr() { unsafe { &(*(0 as *const WithOpaquePtr)).whatever as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithOpaquePtr), "::", stringify!(whatever) @@ -63,7 +63,7 @@ fn bindgen_test_layout_WithOpaquePtr() { unsafe { &(*(0 as *const WithOpaquePtr)).other as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithOpaquePtr), "::", stringify!(other) @@ -73,7 +73,7 @@ fn bindgen_test_layout_WithOpaquePtr() { unsafe { &(*(0 as *const WithOpaquePtr)).t as *const _ as usize }, 12usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithOpaquePtr), "::", stringify!(t) diff --git a/tests/expectations/tests/private.rs b/tests/expectations/tests/private.rs index 400373f885..a63a038bc2 100644 --- a/tests/expectations/tests/private.rs +++ b/tests/expectations/tests/private.rs @@ -27,7 +27,7 @@ fn bindgen_test_layout_HasPrivate() { unsafe { &(*(0 as *const HasPrivate)).mNotPrivate as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(HasPrivate), "::", stringify!(mNotPrivate) @@ -37,7 +37,7 @@ fn bindgen_test_layout_HasPrivate() { unsafe { &(*(0 as *const HasPrivate)).mIsPrivate as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(HasPrivate), "::", stringify!(mIsPrivate) @@ -67,7 +67,7 @@ fn bindgen_test_layout_VeryPrivate() { unsafe { &(*(0 as *const VeryPrivate)).mIsPrivate as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(VeryPrivate), "::", stringify!(mIsPrivate) @@ -77,7 +77,7 @@ fn bindgen_test_layout_VeryPrivate() { unsafe { &(*(0 as *const VeryPrivate)).mIsAlsoPrivate as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(VeryPrivate), "::", stringify!(mIsAlsoPrivate) @@ -108,7 +108,7 @@ fn bindgen_test_layout_ContradictPrivate() { unsafe { &(*(0 as *const ContradictPrivate)).mNotPrivate as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContradictPrivate), "::", stringify!(mNotPrivate) @@ -118,7 +118,7 @@ fn bindgen_test_layout_ContradictPrivate() { unsafe { &(*(0 as *const ContradictPrivate)).mIsPrivate as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContradictPrivate), "::", stringify!(mIsPrivate) diff --git a/tests/expectations/tests/reparented_replacement.rs b/tests/expectations/tests/reparented_replacement.rs index 57a1187116..6a927c514e 100644 --- a/tests/expectations/tests/reparented_replacement.rs +++ b/tests/expectations/tests/reparented_replacement.rs @@ -32,12 +32,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const Bar)).bazz as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(bazz) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(bazz)) ); } } diff --git a/tests/expectations/tests/replace_use.rs b/tests/expectations/tests/replace_use.rs index 5f85dc323f..d9f2e90702 100644 --- a/tests/expectations/tests/replace_use.rs +++ b/tests/expectations/tests/replace_use.rs @@ -31,12 +31,7 @@ fn bindgen_test_layout_Test() { assert_eq!( unsafe { &(*(0 as *const Test)).a as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Test), - "::", - stringify!(a) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(a)) ); } #[test] diff --git a/tests/expectations/tests/same_struct_name_in_different_namespaces.rs b/tests/expectations/tests/same_struct_name_in_different_namespaces.rs index b89568ecb6..c758433202 100644 --- a/tests/expectations/tests/same_struct_name_in_different_namespaces.rs +++ b/tests/expectations/tests/same_struct_name_in_different_namespaces.rs @@ -31,7 +31,7 @@ fn bindgen_test_layout_JS_shadow_Zone() { unsafe { &(*(0 as *const JS_shadow_Zone)).x as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(JS_shadow_Zone), "::", stringify!(x) @@ -41,7 +41,7 @@ fn bindgen_test_layout_JS_shadow_Zone() { unsafe { &(*(0 as *const JS_shadow_Zone)).y as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(JS_shadow_Zone), "::", stringify!(y) diff --git a/tests/expectations/tests/sentry-defined-multiple-times.rs b/tests/expectations/tests/sentry-defined-multiple-times.rs index 96ad812977..8fda8e6269 100644 --- a/tests/expectations/tests/sentry-defined-multiple-times.rs +++ b/tests/expectations/tests/sentry-defined-multiple-times.rs @@ -42,7 +42,7 @@ pub mod root { unsafe { &(*(0 as *const sentry)).i_am_plain_sentry as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(sentry), "::", stringify!(i_am_plain_sentry) @@ -91,7 +91,7 @@ pub mod root { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(NotTemplateWrapper_sentry), "::", stringify!(i_am_not_template_wrapper_sentry) @@ -128,7 +128,7 @@ pub mod root { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(InlineNotTemplateWrapper_sentry), "::", stringify!(i_am_inline_not_template_wrapper_sentry) @@ -230,7 +230,7 @@ pub mod root { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(OuterDoubleWrapper_InnerDoubleWrapper_sentry), "::", stringify!(i_am_double_wrapper_sentry) @@ -277,7 +277,7 @@ pub mod root { }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry), "::", stringify!(i_am_double_wrapper_inline_sentry) @@ -348,7 +348,7 @@ pub mod root { unsafe { &(*(0 as *const sentry)).i_am_outside_namespace_sentry as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(sentry), "::", stringify!(i_am_outside_namespace_sentry) diff --git a/tests/expectations/tests/size_t_template.rs b/tests/expectations/tests/size_t_template.rs index 9fa6c3ad77..9229723b89 100644 --- a/tests/expectations/tests/size_t_template.rs +++ b/tests/expectations/tests/size_t_template.rs @@ -24,6 +24,6 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).arr as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(arr)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(arr)) ); } diff --git a/tests/expectations/tests/struct_containing_forward_declared_struct.rs b/tests/expectations/tests/struct_containing_forward_declared_struct.rs index f20b9b3a7c..dae498d43a 100644 --- a/tests/expectations/tests/struct_containing_forward_declared_struct.rs +++ b/tests/expectations/tests/struct_containing_forward_declared_struct.rs @@ -24,12 +24,7 @@ fn bindgen_test_layout_a() { assert_eq!( unsafe { &(*(0 as *const a)).val_a as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(a), - "::", - stringify!(val_a) - ) + concat!("Offset of field: ", stringify!(a), "::", stringify!(val_a)) ); } impl Default for a { @@ -57,11 +52,6 @@ fn bindgen_test_layout_b() { assert_eq!( unsafe { &(*(0 as *const b)).val_b as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(b), - "::", - stringify!(val_b) - ) + concat!("Offset of field: ", stringify!(b), "::", stringify!(val_b)) ); } diff --git a/tests/expectations/tests/struct_typedef.rs b/tests/expectations/tests/struct_typedef.rs index 1079bb3fa9..958a3c3af6 100644 --- a/tests/expectations/tests/struct_typedef.rs +++ b/tests/expectations/tests/struct_typedef.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_typedef_named_struct() { unsafe { &(*(0 as *const typedef_named_struct)).has_name as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(typedef_named_struct), "::", stringify!(has_name) @@ -53,7 +53,7 @@ fn bindgen_test_layout__bindgen_ty_1() { unsafe { &(*(0 as *const _bindgen_ty_1)).no_name as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(_bindgen_ty_1), "::", stringify!(no_name) diff --git a/tests/expectations/tests/struct_typedef_ns.rs b/tests/expectations/tests/struct_typedef_ns.rs index b40c1733d0..b6ef136e86 100644 --- a/tests/expectations/tests/struct_typedef_ns.rs +++ b/tests/expectations/tests/struct_typedef_ns.rs @@ -32,7 +32,7 @@ pub mod root { unsafe { &(*(0 as *const typedef_struct)).foo as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(typedef_struct), "::", stringify!(foo) @@ -69,7 +69,7 @@ pub mod root { unsafe { &(*(0 as *const _bindgen_ty_1)).foo as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(_bindgen_ty_1), "::", stringify!(foo) diff --git a/tests/expectations/tests/struct_with_anon_struct.rs b/tests/expectations/tests/struct_with_anon_struct.rs index b8726df08f..046aeb697d 100644 --- a/tests/expectations/tests/struct_with_anon_struct.rs +++ b/tests/expectations/tests/struct_with_anon_struct.rs @@ -31,7 +31,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -41,7 +41,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -63,11 +63,6 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } diff --git a/tests/expectations/tests/struct_with_anon_struct_array.rs b/tests/expectations/tests/struct_with_anon_struct_array.rs index 8616ba5d75..61e14cc304 100644 --- a/tests/expectations/tests/struct_with_anon_struct_array.rs +++ b/tests/expectations/tests/struct_with_anon_struct_array.rs @@ -32,7 +32,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -42,7 +42,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -71,7 +71,7 @@ fn bindgen_test_layout_foo__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_2)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_2), "::", stringify!(a) @@ -81,7 +81,7 @@ fn bindgen_test_layout_foo__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_2)).b as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_2), "::", stringify!(b) @@ -103,21 +103,11 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); assert_eq!( unsafe { &(*(0 as *const foo)).baz as *const _ as usize }, 16usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(baz)) ); } diff --git a/tests/expectations/tests/struct_with_anon_struct_pointer.rs b/tests/expectations/tests/struct_with_anon_struct_pointer.rs index 733721be38..34bf3416ea 100644 --- a/tests/expectations/tests/struct_with_anon_struct_pointer.rs +++ b/tests/expectations/tests/struct_with_anon_struct_pointer.rs @@ -31,7 +31,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -41,7 +41,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -63,12 +63,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } impl Default for foo { diff --git a/tests/expectations/tests/struct_with_anon_union.rs b/tests/expectations/tests/struct_with_anon_union.rs index 716461ea51..13acc29428 100644 --- a/tests/expectations/tests/struct_with_anon_union.rs +++ b/tests/expectations/tests/struct_with_anon_union.rs @@ -32,7 +32,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -42,7 +42,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -69,12 +69,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } impl Default for foo { diff --git a/tests/expectations/tests/struct_with_anon_union_1_0.rs b/tests/expectations/tests/struct_with_anon_union_1_0.rs index e02e78e916..0342214b86 100644 --- a/tests/expectations/tests/struct_with_anon_union_1_0.rs +++ b/tests/expectations/tests/struct_with_anon_union_1_0.rs @@ -75,7 +75,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -85,7 +85,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -112,12 +112,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } impl Clone for foo { diff --git a/tests/expectations/tests/struct_with_anon_unnamed_struct.rs b/tests/expectations/tests/struct_with_anon_unnamed_struct.rs index 839023ecbb..e73f01e3b4 100644 --- a/tests/expectations/tests/struct_with_anon_unnamed_struct.rs +++ b/tests/expectations/tests/struct_with_anon_unnamed_struct.rs @@ -31,7 +31,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -41,7 +41,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) diff --git a/tests/expectations/tests/struct_with_anon_unnamed_union.rs b/tests/expectations/tests/struct_with_anon_unnamed_union.rs index 3cb92db746..0caf679f02 100644 --- a/tests/expectations/tests/struct_with_anon_unnamed_union.rs +++ b/tests/expectations/tests/struct_with_anon_unnamed_union.rs @@ -32,7 +32,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -42,7 +42,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) diff --git a/tests/expectations/tests/struct_with_anon_unnamed_union_1_0.rs b/tests/expectations/tests/struct_with_anon_unnamed_union_1_0.rs index 0f958b039a..1809dd7c1b 100644 --- a/tests/expectations/tests/struct_with_anon_unnamed_union_1_0.rs +++ b/tests/expectations/tests/struct_with_anon_unnamed_union_1_0.rs @@ -75,7 +75,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -85,7 +85,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) diff --git a/tests/expectations/tests/struct_with_bitfields.rs b/tests/expectations/tests/struct_with_bitfields.rs index 9c7b30072e..7abc2f0525 100644 --- a/tests/expectations/tests/struct_with_bitfields.rs +++ b/tests/expectations/tests/struct_with_bitfields.rs @@ -27,7 +27,7 @@ fn bindgen_test_layout_bitfield() { unsafe { &(*(0 as *const bitfield)).e as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(bitfield), "::", stringify!(e) diff --git a/tests/expectations/tests/struct_with_derive_debug.rs b/tests/expectations/tests/struct_with_derive_debug.rs index 4a068de59e..08b486fcb3 100644 --- a/tests/expectations/tests/struct_with_derive_debug.rs +++ b/tests/expectations/tests/struct_with_derive_debug.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_LittleArray() { unsafe { &(*(0 as *const LittleArray)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(LittleArray), "::", stringify!(a) @@ -53,7 +53,7 @@ fn bindgen_test_layout_BigArray() { unsafe { &(*(0 as *const BigArray)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(BigArray), "::", stringify!(a) @@ -86,7 +86,7 @@ fn bindgen_test_layout_WithLittleArray() { unsafe { &(*(0 as *const WithLittleArray)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithLittleArray), "::", stringify!(a) @@ -114,7 +114,7 @@ fn bindgen_test_layout_WithBigArray() { unsafe { &(*(0 as *const WithBigArray)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigArray), "::", stringify!(a) diff --git a/tests/expectations/tests/struct_with_large_array.rs b/tests/expectations/tests/struct_with_large_array.rs index decc5934df..8f11192675 100644 --- a/tests/expectations/tests/struct_with_large_array.rs +++ b/tests/expectations/tests/struct_with_large_array.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_S() { unsafe { &(*(0 as *const S)).large_array as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(S), "::", stringify!(large_array) diff --git a/tests/expectations/tests/struct_with_nesting.rs b/tests/expectations/tests/struct_with_nesting.rs index 08fbc52c03..ceb436952c 100644 --- a/tests/expectations/tests/struct_with_nesting.rs +++ b/tests/expectations/tests/struct_with_nesting.rs @@ -40,7 +40,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_1)).c1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_1), "::", stringify!(c1) @@ -50,7 +50,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_1)).c2 as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_1), "::", stringify!(c2) @@ -81,7 +81,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).d1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(d1) @@ -91,7 +91,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).d2 as *const _ as usize }, 1usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(d2) @@ -101,7 +101,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).d3 as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(d3) @@ -111,7 +111,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).d4 as *const _ as usize }, 3usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(d4) @@ -134,7 +134,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -161,7 +161,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(a)) ); } impl Default for foo { diff --git a/tests/expectations/tests/struct_with_nesting_1_0.rs b/tests/expectations/tests/struct_with_nesting_1_0.rs index 4701409aab..3c4e954297 100644 --- a/tests/expectations/tests/struct_with_nesting_1_0.rs +++ b/tests/expectations/tests/struct_with_nesting_1_0.rs @@ -83,7 +83,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_1)).c1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_1), "::", stringify!(c1) @@ -93,7 +93,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_1)).c2 as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_1), "::", stringify!(c2) @@ -129,7 +129,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).d1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(d1) @@ -139,7 +139,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).d2 as *const _ as usize }, 1usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(d2) @@ -149,7 +149,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).d3 as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(d3) @@ -159,7 +159,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).d4 as *const _ as usize }, 3usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(d4) @@ -187,7 +187,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -214,7 +214,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(a)) ); } impl Clone for foo { diff --git a/tests/expectations/tests/struct_with_packing.rs b/tests/expectations/tests/struct_with_packing.rs index b942ebd185..c4b9e38e2c 100644 --- a/tests/expectations/tests/struct_with_packing.rs +++ b/tests/expectations/tests/struct_with_packing.rs @@ -25,11 +25,11 @@ fn bindgen_test_layout_a() { assert_eq!( unsafe { &(*(0 as *const a)).b as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(a), "::", stringify!(b)) + concat!("Offset of field: ", stringify!(a), "::", stringify!(b)) ); assert_eq!( unsafe { &(*(0 as *const a)).c as *const _ as usize }, 1usize, - concat!("Alignment of field: ", stringify!(a), "::", stringify!(c)) + concat!("Offset of field: ", stringify!(a), "::", stringify!(c)) ); } diff --git a/tests/expectations/tests/struct_with_struct.rs b/tests/expectations/tests/struct_with_struct.rs index 1549438776..8e606a0c7a 100644 --- a/tests/expectations/tests/struct_with_struct.rs +++ b/tests/expectations/tests/struct_with_struct.rs @@ -31,7 +31,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).x as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(x) @@ -41,7 +41,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).y as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(y) @@ -63,11 +63,6 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } diff --git a/tests/expectations/tests/template.rs b/tests/expectations/tests/template.rs index 999b81c725..1bc3d38a7c 100644 --- a/tests/expectations/tests/template.rs +++ b/tests/expectations/tests/template.rs @@ -71,13 +71,13 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).mB as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(mB)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(mB)) ); assert_eq!( unsafe { &(*(0 as *const C)).mBConstPtr as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBConstPtr) @@ -87,7 +87,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mBConstStructPtr as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBConstStructPtr) @@ -97,7 +97,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mBConstStructPtrArray as *const _ as usize }, 24usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBConstStructPtrArray) @@ -107,7 +107,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mBConst as *const _ as usize }, 32usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBConst) @@ -117,7 +117,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mBVolatile as *const _ as usize }, 36usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBVolatile) @@ -127,7 +127,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mBConstBool as *const _ as usize }, 40usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBConstBool) @@ -137,7 +137,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mBConstChar as *const _ as usize }, 42usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBConstChar) @@ -147,7 +147,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mBArray as *const _ as usize }, 44usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBArray) @@ -157,7 +157,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mBPtrArray as *const _ as usize }, 48usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBPtrArray) @@ -167,7 +167,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mBArrayPtr as *const _ as usize }, 56usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBArrayPtr) @@ -176,18 +176,13 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).mBRef as *const _ as usize }, 64usize, - concat!( - "Alignment of field: ", - stringify!(C), - "::", - stringify!(mBRef) - ) + concat!("Offset of field: ", stringify!(C), "::", stringify!(mBRef)) ); assert_eq!( unsafe { &(*(0 as *const C)).mBConstRef as *const _ as usize }, 72usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mBConstRef) @@ -197,7 +192,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mPtrRef as *const _ as usize }, 80usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mPtrRef) @@ -207,7 +202,7 @@ fn bindgen_test_layout_C() { unsafe { &(*(0 as *const C)).mArrayRef as *const _ as usize }, 88usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(C), "::", stringify!(mArrayRef) @@ -276,7 +271,7 @@ fn bindgen_test_layout_RootedContainer() { unsafe { &(*(0 as *const RootedContainer)).root as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(RootedContainer), "::", stringify!(root) @@ -321,7 +316,7 @@ fn bindgen_test_layout_PODButContainsDtor() { unsafe { &(*(0 as *const PODButContainsDtor)).member as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(PODButContainsDtor), "::", stringify!(member) @@ -360,7 +355,7 @@ fn bindgen_test_layout_POD() { unsafe { &(*(0 as *const POD)).opaque_member as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(POD), "::", stringify!(opaque_member) diff --git a/tests/expectations/tests/test_multiple_header_calls_in_builder.rs b/tests/expectations/tests/test_multiple_header_calls_in_builder.rs index b6ab186a3f..c9ef7de6d9 100644 --- a/tests/expectations/tests/test_multiple_header_calls_in_builder.rs +++ b/tests/expectations/tests/test_multiple_header_calls_in_builder.rs @@ -43,7 +43,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).ch as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(ch) @@ -53,7 +53,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).u as *const _ as usize }, 1usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(u) @@ -63,7 +63,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).d as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(d) @@ -73,7 +73,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).cch as *const _ as usize }, 3usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(cch) @@ -83,7 +83,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).cu as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(cu) @@ -93,7 +93,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).cd as *const _ as usize }, 5usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(cd) @@ -103,7 +103,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).Cch as *const _ as usize }, 6usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(Cch) @@ -113,7 +113,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).Cu as *const _ as usize }, 7usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(Cu) @@ -123,7 +123,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).Cd as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(Cd) @@ -133,7 +133,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).Ccch as *const _ as usize }, 9usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(Ccch) @@ -143,7 +143,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).Ccu as *const _ as usize }, 10usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(Ccu) @@ -153,7 +153,7 @@ fn bindgen_test_layout_Test() { unsafe { &(*(0 as *const Test)).Ccd as *const _ as usize }, 11usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(Ccd) diff --git a/tests/expectations/tests/type-referenced-by-whitelisted-function.rs b/tests/expectations/tests/type-referenced-by-whitelisted-function.rs index 73902a4260..04aac65df2 100644 --- a/tests/expectations/tests/type-referenced-by-whitelisted-function.rs +++ b/tests/expectations/tests/type-referenced-by-whitelisted-function.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_dl_phdr_info() { unsafe { &(*(0 as *const dl_phdr_info)).x as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(dl_phdr_info), "::", stringify!(x) diff --git a/tests/expectations/tests/typeref.rs b/tests/expectations/tests/typeref.rs index 7376aa7694..fd81020412 100644 --- a/tests/expectations/tests/typeref.rs +++ b/tests/expectations/tests/typeref.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_mozilla_FragmentOrURL() { unsafe { &(*(0 as *const mozilla_FragmentOrURL)).mIsLocalRef as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(mozilla_FragmentOrURL), "::", stringify!(mIsLocalRef) @@ -90,12 +90,7 @@ fn bindgen_test_layout_Bar() { assert_eq!( unsafe { &(*(0 as *const Bar)).mFoo as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(mFoo) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(mFoo)) ); } impl Default for Bar { @@ -123,7 +118,7 @@ fn bindgen_test_layout_nsFoo() { unsafe { &(*(0 as *const nsFoo)).mBar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsFoo), "::", stringify!(mBar) diff --git a/tests/expectations/tests/typeref_1_0.rs b/tests/expectations/tests/typeref_1_0.rs index 6796ced809..b2bd25d509 100644 --- a/tests/expectations/tests/typeref_1_0.rs +++ b/tests/expectations/tests/typeref_1_0.rs @@ -68,7 +68,7 @@ fn bindgen_test_layout_mozilla_FragmentOrURL() { unsafe { &(*(0 as *const mozilla_FragmentOrURL)).mIsLocalRef as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(mozilla_FragmentOrURL), "::", stringify!(mIsLocalRef) @@ -135,12 +135,7 @@ fn bindgen_test_layout_Bar() { assert_eq!( unsafe { &(*(0 as *const Bar)).mFoo as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(Bar), - "::", - stringify!(mFoo) - ) + concat!("Offset of field: ", stringify!(Bar), "::", stringify!(mFoo)) ); } impl Clone for Bar { @@ -174,7 +169,7 @@ fn bindgen_test_layout_nsFoo() { unsafe { &(*(0 as *const nsFoo)).mBar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsFoo), "::", stringify!(mBar) diff --git a/tests/expectations/tests/underscore.rs b/tests/expectations/tests/underscore.rs index d9c61f7b6d..082bad9a84 100644 --- a/tests/expectations/tests/underscore.rs +++ b/tests/expectations/tests/underscore.rs @@ -25,11 +25,6 @@ fn bindgen_test_layout_ptr_t() { assert_eq!( unsafe { &(*(0 as *const ptr_t)).__ as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(ptr_t), - "::", - stringify!(__) - ) + concat!("Offset of field: ", stringify!(ptr_t), "::", stringify!(__)) ); } diff --git a/tests/expectations/tests/union-in-ns.rs b/tests/expectations/tests/union-in-ns.rs index 9776626c8d..832071873c 100644 --- a/tests/expectations/tests/union-in-ns.rs +++ b/tests/expectations/tests/union-in-ns.rs @@ -29,12 +29,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const bar)).baz as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(bar), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(bar), "::", stringify!(baz)) ); } impl Default for bar { diff --git a/tests/expectations/tests/union-in-ns_1_0.rs b/tests/expectations/tests/union-in-ns_1_0.rs index ec2014a519..8f5c115d64 100644 --- a/tests/expectations/tests/union-in-ns_1_0.rs +++ b/tests/expectations/tests/union-in-ns_1_0.rs @@ -72,12 +72,7 @@ pub mod root { assert_eq!( unsafe { &(*(0 as *const bar)).baz as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(bar), - "::", - stringify!(baz) - ) + concat!("Offset of field: ", stringify!(bar), "::", stringify!(baz)) ); } impl Clone for bar { diff --git a/tests/expectations/tests/union_dtor.rs b/tests/expectations/tests/union_dtor.rs index e62521bc07..d21ed0da69 100644 --- a/tests/expectations/tests/union_dtor.rs +++ b/tests/expectations/tests/union_dtor.rs @@ -26,7 +26,7 @@ fn bindgen_test_layout_UnionWithDtor() { unsafe { &(*(0 as *const UnionWithDtor)).mFoo as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(UnionWithDtor), "::", stringify!(mFoo) @@ -36,7 +36,7 @@ fn bindgen_test_layout_UnionWithDtor() { unsafe { &(*(0 as *const UnionWithDtor)).mBar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(UnionWithDtor), "::", stringify!(mBar) diff --git a/tests/expectations/tests/union_dtor_1_0.rs b/tests/expectations/tests/union_dtor_1_0.rs index f7896dc736..60cd6e2b34 100644 --- a/tests/expectations/tests/union_dtor_1_0.rs +++ b/tests/expectations/tests/union_dtor_1_0.rs @@ -70,7 +70,7 @@ fn bindgen_test_layout_UnionWithDtor() { unsafe { &(*(0 as *const UnionWithDtor)).mFoo as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(UnionWithDtor), "::", stringify!(mFoo) @@ -80,7 +80,7 @@ fn bindgen_test_layout_UnionWithDtor() { unsafe { &(*(0 as *const UnionWithDtor)).mBar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(UnionWithDtor), "::", stringify!(mBar) diff --git a/tests/expectations/tests/union_fields.rs b/tests/expectations/tests/union_fields.rs index 0c723b2a1c..83cd47e31d 100644 --- a/tests/expectations/tests/union_fields.rs +++ b/tests/expectations/tests/union_fields.rs @@ -28,7 +28,7 @@ fn bindgen_test_layout_nsStyleUnion() { unsafe { &(*(0 as *const nsStyleUnion)).mInt as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsStyleUnion), "::", stringify!(mInt) @@ -38,7 +38,7 @@ fn bindgen_test_layout_nsStyleUnion() { unsafe { &(*(0 as *const nsStyleUnion)).mFloat as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsStyleUnion), "::", stringify!(mFloat) @@ -48,7 +48,7 @@ fn bindgen_test_layout_nsStyleUnion() { unsafe { &(*(0 as *const nsStyleUnion)).mPointer as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsStyleUnion), "::", stringify!(mPointer) diff --git a/tests/expectations/tests/union_fields_1_0.rs b/tests/expectations/tests/union_fields_1_0.rs index 1e10ff971c..1a2a735f05 100644 --- a/tests/expectations/tests/union_fields_1_0.rs +++ b/tests/expectations/tests/union_fields_1_0.rs @@ -71,7 +71,7 @@ fn bindgen_test_layout_nsStyleUnion() { unsafe { &(*(0 as *const nsStyleUnion)).mInt as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsStyleUnion), "::", stringify!(mInt) @@ -81,7 +81,7 @@ fn bindgen_test_layout_nsStyleUnion() { unsafe { &(*(0 as *const nsStyleUnion)).mFloat as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsStyleUnion), "::", stringify!(mFloat) @@ -91,7 +91,7 @@ fn bindgen_test_layout_nsStyleUnion() { unsafe { &(*(0 as *const nsStyleUnion)).mPointer as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(nsStyleUnion), "::", stringify!(mPointer) diff --git a/tests/expectations/tests/union_with_anon_struct.rs b/tests/expectations/tests/union_with_anon_struct.rs index 87bcf6f3d6..e512b6fc39 100644 --- a/tests/expectations/tests/union_with_anon_struct.rs +++ b/tests/expectations/tests/union_with_anon_struct.rs @@ -32,7 +32,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -42,7 +42,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -64,12 +64,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } impl Default for foo { diff --git a/tests/expectations/tests/union_with_anon_struct_1_0.rs b/tests/expectations/tests/union_with_anon_struct_1_0.rs index b79be1277e..be2304313f 100644 --- a/tests/expectations/tests/union_with_anon_struct_1_0.rs +++ b/tests/expectations/tests/union_with_anon_struct_1_0.rs @@ -75,7 +75,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -85,7 +85,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 4usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -112,12 +112,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } impl Clone for foo { diff --git a/tests/expectations/tests/union_with_anon_struct_bitfield.rs b/tests/expectations/tests/union_with_anon_struct_bitfield.rs index ef5c16707c..459035b680 100644 --- a/tests/expectations/tests/union_with_anon_struct_bitfield.rs +++ b/tests/expectations/tests/union_with_anon_struct_bitfield.rs @@ -124,7 +124,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(a)) ); } impl Default for foo { diff --git a/tests/expectations/tests/union_with_anon_struct_bitfield_1_0.rs b/tests/expectations/tests/union_with_anon_struct_bitfield_1_0.rs index 803d6cde72..85dd0cd88c 100644 --- a/tests/expectations/tests/union_with_anon_struct_bitfield_1_0.rs +++ b/tests/expectations/tests/union_with_anon_struct_bitfield_1_0.rs @@ -172,7 +172,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(a)) ); } impl Clone for foo { diff --git a/tests/expectations/tests/union_with_anon_union.rs b/tests/expectations/tests/union_with_anon_union.rs index 92f8559587..4e35267b8b 100644 --- a/tests/expectations/tests/union_with_anon_union.rs +++ b/tests/expectations/tests/union_with_anon_union.rs @@ -33,7 +33,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -43,7 +43,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -70,12 +70,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } impl Default for foo { diff --git a/tests/expectations/tests/union_with_anon_union_1_0.rs b/tests/expectations/tests/union_with_anon_union_1_0.rs index 958d8e67d7..22f254cf79 100644 --- a/tests/expectations/tests/union_with_anon_union_1_0.rs +++ b/tests/expectations/tests/union_with_anon_union_1_0.rs @@ -76,7 +76,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(a) @@ -86,7 +86,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -113,12 +113,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).bar as *const _ as usize }, 0usize, - concat!( - "Alignment of field: ", - stringify!(foo), - "::", - stringify!(bar) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } impl Clone for foo { diff --git a/tests/expectations/tests/union_with_anon_unnamed_struct.rs b/tests/expectations/tests/union_with_anon_unnamed_struct.rs index 1f5e493f72..50d749c22e 100644 --- a/tests/expectations/tests/union_with_anon_unnamed_struct.rs +++ b/tests/expectations/tests/union_with_anon_unnamed_struct.rs @@ -35,7 +35,7 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { unsafe { &(*(0 as *const pixel__bindgen_ty_1)).r as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(pixel__bindgen_ty_1), "::", stringify!(r) @@ -45,7 +45,7 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { unsafe { &(*(0 as *const pixel__bindgen_ty_1)).g as *const _ as usize }, 1usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(pixel__bindgen_ty_1), "::", stringify!(g) @@ -55,7 +55,7 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { unsafe { &(*(0 as *const pixel__bindgen_ty_1)).b as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(pixel__bindgen_ty_1), "::", stringify!(b) @@ -65,7 +65,7 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { unsafe { &(*(0 as *const pixel__bindgen_ty_1)).a as *const _ as usize }, 3usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(pixel__bindgen_ty_1), "::", stringify!(a) @@ -88,7 +88,7 @@ fn bindgen_test_layout_pixel() { unsafe { &(*(0 as *const pixel)).rgba as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(pixel), "::", stringify!(rgba) diff --git a/tests/expectations/tests/union_with_anon_unnamed_struct_1_0.rs b/tests/expectations/tests/union_with_anon_unnamed_struct_1_0.rs index d0dc0088cd..c72b924038 100644 --- a/tests/expectations/tests/union_with_anon_unnamed_struct_1_0.rs +++ b/tests/expectations/tests/union_with_anon_unnamed_struct_1_0.rs @@ -78,7 +78,7 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { unsafe { &(*(0 as *const pixel__bindgen_ty_1)).r as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(pixel__bindgen_ty_1), "::", stringify!(r) @@ -88,7 +88,7 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { unsafe { &(*(0 as *const pixel__bindgen_ty_1)).g as *const _ as usize }, 1usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(pixel__bindgen_ty_1), "::", stringify!(g) @@ -98,7 +98,7 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { unsafe { &(*(0 as *const pixel__bindgen_ty_1)).b as *const _ as usize }, 2usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(pixel__bindgen_ty_1), "::", stringify!(b) @@ -108,7 +108,7 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { unsafe { &(*(0 as *const pixel__bindgen_ty_1)).a as *const _ as usize }, 3usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(pixel__bindgen_ty_1), "::", stringify!(a) @@ -136,7 +136,7 @@ fn bindgen_test_layout_pixel() { unsafe { &(*(0 as *const pixel)).rgba as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(pixel), "::", stringify!(rgba) diff --git a/tests/expectations/tests/union_with_anon_unnamed_union.rs b/tests/expectations/tests/union_with_anon_unnamed_union.rs index ba0cf84ed8..bc53aeccc7 100644 --- a/tests/expectations/tests/union_with_anon_unnamed_union.rs +++ b/tests/expectations/tests/union_with_anon_unnamed_union.rs @@ -34,7 +34,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -44,7 +44,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).c as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(c) @@ -71,7 +71,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(a)) ); } impl Default for foo { diff --git a/tests/expectations/tests/union_with_anon_unnamed_union_1_0.rs b/tests/expectations/tests/union_with_anon_unnamed_union_1_0.rs index d746d45d7d..07f1054b5b 100644 --- a/tests/expectations/tests/union_with_anon_unnamed_union_1_0.rs +++ b/tests/expectations/tests/union_with_anon_unnamed_union_1_0.rs @@ -77,7 +77,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(b) @@ -87,7 +87,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1)).c as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1), "::", stringify!(c) @@ -114,7 +114,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(a)) ); } impl Clone for foo { diff --git a/tests/expectations/tests/union_with_big_member.rs b/tests/expectations/tests/union_with_big_member.rs index e0767ba273..77a1c9b40d 100644 --- a/tests/expectations/tests/union_with_big_member.rs +++ b/tests/expectations/tests/union_with_big_member.rs @@ -27,7 +27,7 @@ fn bindgen_test_layout_WithBigArray() { unsafe { &(*(0 as *const WithBigArray)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigArray), "::", stringify!(a) @@ -37,7 +37,7 @@ fn bindgen_test_layout_WithBigArray() { unsafe { &(*(0 as *const WithBigArray)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigArray), "::", stringify!(b) @@ -72,7 +72,7 @@ fn bindgen_test_layout_WithBigArray2() { unsafe { &(*(0 as *const WithBigArray2)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigArray2), "::", stringify!(a) @@ -82,7 +82,7 @@ fn bindgen_test_layout_WithBigArray2() { unsafe { &(*(0 as *const WithBigArray2)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigArray2), "::", stringify!(b) @@ -117,7 +117,7 @@ fn bindgen_test_layout_WithBigMember() { unsafe { &(*(0 as *const WithBigMember)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigMember), "::", stringify!(a) @@ -127,7 +127,7 @@ fn bindgen_test_layout_WithBigMember() { unsafe { &(*(0 as *const WithBigMember)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigMember), "::", stringify!(b) diff --git a/tests/expectations/tests/union_with_big_member_1_0.rs b/tests/expectations/tests/union_with_big_member_1_0.rs index abf86dc8e5..037720b93e 100644 --- a/tests/expectations/tests/union_with_big_member_1_0.rs +++ b/tests/expectations/tests/union_with_big_member_1_0.rs @@ -70,7 +70,7 @@ fn bindgen_test_layout_WithBigArray() { unsafe { &(*(0 as *const WithBigArray)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigArray), "::", stringify!(a) @@ -80,7 +80,7 @@ fn bindgen_test_layout_WithBigArray() { unsafe { &(*(0 as *const WithBigArray)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigArray), "::", stringify!(b) @@ -120,7 +120,7 @@ fn bindgen_test_layout_WithBigArray2() { unsafe { &(*(0 as *const WithBigArray2)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigArray2), "::", stringify!(a) @@ -130,7 +130,7 @@ fn bindgen_test_layout_WithBigArray2() { unsafe { &(*(0 as *const WithBigArray2)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigArray2), "::", stringify!(b) @@ -165,7 +165,7 @@ fn bindgen_test_layout_WithBigMember() { unsafe { &(*(0 as *const WithBigMember)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigMember), "::", stringify!(a) @@ -175,7 +175,7 @@ fn bindgen_test_layout_WithBigMember() { unsafe { &(*(0 as *const WithBigMember)).b as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WithBigMember), "::", stringify!(b) diff --git a/tests/expectations/tests/union_with_nesting.rs b/tests/expectations/tests/union_with_nesting.rs index 1969a33c5c..0375996cff 100644 --- a/tests/expectations/tests/union_with_nesting.rs +++ b/tests/expectations/tests/union_with_nesting.rs @@ -40,7 +40,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_1)).b1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_1), "::", stringify!(b1) @@ -50,7 +50,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_1)).b2 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_1), "::", stringify!(b2) @@ -85,7 +85,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).c1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(c1) @@ -95,7 +95,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).c2 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(c2) @@ -140,7 +140,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(a)) ); } impl Default for foo { diff --git a/tests/expectations/tests/union_with_nesting_1_0.rs b/tests/expectations/tests/union_with_nesting_1_0.rs index 1667c07e06..e75a1bc728 100644 --- a/tests/expectations/tests/union_with_nesting_1_0.rs +++ b/tests/expectations/tests/union_with_nesting_1_0.rs @@ -83,7 +83,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_1)).b1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_1), "::", stringify!(b1) @@ -93,7 +93,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_1)).b2 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_1), "::", stringify!(b2) @@ -128,7 +128,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).c1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(c1) @@ -138,7 +138,7 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { unsafe { &(*(0 as *const foo__bindgen_ty_1__bindgen_ty_2)).c2 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo__bindgen_ty_1__bindgen_ty_2), "::", stringify!(c2) @@ -183,7 +183,7 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(a)) ); } impl Clone for foo { diff --git a/tests/expectations/tests/unknown_attr.rs b/tests/expectations/tests/unknown_attr.rs index b5d83c2e29..fe5d046da3 100644 --- a/tests/expectations/tests/unknown_attr.rs +++ b/tests/expectations/tests/unknown_attr.rs @@ -23,7 +23,7 @@ fn bindgen_test_layout_max_align_t() { unsafe { &(*(0 as *const max_align_t)).__clang_max_align_nonce1 as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(max_align_t), "::", stringify!(__clang_max_align_nonce1) @@ -33,7 +33,7 @@ fn bindgen_test_layout_max_align_t() { unsafe { &(*(0 as *const max_align_t)).__clang_max_align_nonce2 as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(max_align_t), "::", stringify!(__clang_max_align_nonce2) diff --git a/tests/expectations/tests/use-core.rs b/tests/expectations/tests/use-core.rs index ebbfb9358c..ded9b9d48b 100644 --- a/tests/expectations/tests/use-core.rs +++ b/tests/expectations/tests/use-core.rs @@ -27,22 +27,17 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset 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)) + concat!("Offset 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) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } impl Default for foo { @@ -73,7 +68,7 @@ fn bindgen_test_layout__bindgen_ty_1() { unsafe { &(*(0 as *const _bindgen_ty_1)).bar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(_bindgen_ty_1), "::", stringify!(bar) @@ -83,7 +78,7 @@ fn bindgen_test_layout__bindgen_ty_1() { unsafe { &(*(0 as *const _bindgen_ty_1)).baz as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(_bindgen_ty_1), "::", stringify!(baz) diff --git a/tests/expectations/tests/use-core_1_0.rs b/tests/expectations/tests/use-core_1_0.rs index 4342d60627..5ddf17fe33 100644 --- a/tests/expectations/tests/use-core_1_0.rs +++ b/tests/expectations/tests/use-core_1_0.rs @@ -70,22 +70,17 @@ fn bindgen_test_layout_foo() { assert_eq!( unsafe { &(*(0 as *const foo)).a as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a)) + concat!("Offset 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)) + concat!("Offset 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) - ) + concat!("Offset of field: ", stringify!(foo), "::", stringify!(bar)) ); } impl Clone for foo { @@ -121,7 +116,7 @@ fn bindgen_test_layout__bindgen_ty_1() { unsafe { &(*(0 as *const _bindgen_ty_1)).bar as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(_bindgen_ty_1), "::", stringify!(bar) @@ -131,7 +126,7 @@ fn bindgen_test_layout__bindgen_ty_1() { unsafe { &(*(0 as *const _bindgen_ty_1)).baz as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(_bindgen_ty_1), "::", stringify!(baz) diff --git a/tests/expectations/tests/var-tracing.rs b/tests/expectations/tests/var-tracing.rs index d99526c7a7..ec5e6871b0 100644 --- a/tests/expectations/tests/var-tracing.rs +++ b/tests/expectations/tests/var-tracing.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_Bar() { unsafe { &(*(0 as *const Bar)).m_baz as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Bar), "::", stringify!(m_baz) diff --git a/tests/expectations/tests/vector.rs b/tests/expectations/tests/vector.rs index c75e9829c9..4ad9a62641 100644 --- a/tests/expectations/tests/vector.rs +++ b/tests/expectations/tests/vector.rs @@ -25,7 +25,7 @@ fn bindgen_test_layout_foo() { unsafe { &(*(0 as *const foo)).mMember as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(foo), "::", stringify!(mMember) diff --git a/tests/expectations/tests/virtual_inheritance.rs b/tests/expectations/tests/virtual_inheritance.rs index c4f7abfa98..023d703bc1 100644 --- a/tests/expectations/tests/virtual_inheritance.rs +++ b/tests/expectations/tests/virtual_inheritance.rs @@ -24,7 +24,7 @@ fn bindgen_test_layout_A() { assert_eq!( unsafe { &(*(0 as *const A)).foo as *const _ as usize }, 0usize, - concat!("Alignment of field: ", stringify!(A), "::", stringify!(foo)) + concat!("Offset of field: ", stringify!(A), "::", stringify!(foo)) ); } #[repr(C)] @@ -50,7 +50,7 @@ fn bindgen_test_layout_B() { assert_eq!( unsafe { &(*(0 as *const B)).bar as *const _ as usize }, 8usize, - concat!("Alignment of field: ", stringify!(B), "::", stringify!(bar)) + concat!("Offset of field: ", stringify!(B), "::", stringify!(bar)) ); } impl Default for B { @@ -81,7 +81,7 @@ fn bindgen_test_layout_C() { assert_eq!( unsafe { &(*(0 as *const C)).baz as *const _ as usize }, 8usize, - concat!("Alignment of field: ", stringify!(C), "::", stringify!(baz)) + concat!("Offset of field: ", stringify!(C), "::", stringify!(baz)) ); } impl Default for C { diff --git a/tests/expectations/tests/weird_bitfields.rs b/tests/expectations/tests/weird_bitfields.rs index ac73b70966..14276a3efc 100644 --- a/tests/expectations/tests/weird_bitfields.rs +++ b/tests/expectations/tests/weird_bitfields.rs @@ -46,7 +46,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mStrokeDasharrayLength as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mStrokeDasharrayLength) @@ -56,7 +56,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mClipRule as *const _ as usize }, 8usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mClipRule) @@ -66,7 +66,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mColorInterpolation as *const _ as usize }, 9usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mColorInterpolation) @@ -76,7 +76,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mColorInterpolationFilters as *const _ as usize }, 10usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mColorInterpolationFilters) @@ -86,7 +86,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mFillRule as *const _ as usize }, 11usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mFillRule) @@ -96,7 +96,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mImageRendering as *const _ as usize }, 12usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mImageRendering) @@ -106,7 +106,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mPaintOrder as *const _ as usize }, 13usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mPaintOrder) @@ -116,7 +116,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mShapeRendering as *const _ as usize }, 14usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mShapeRendering) @@ -126,7 +126,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mStrokeLinecap as *const _ as usize }, 15usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mStrokeLinecap) @@ -136,7 +136,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mStrokeLinejoin as *const _ as usize }, 16usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mStrokeLinejoin) @@ -146,7 +146,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mTextAnchor as *const _ as usize }, 17usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mTextAnchor) @@ -156,7 +156,7 @@ fn bindgen_test_layout_Weird() { unsafe { &(*(0 as *const Weird)).mTextRendering as *const _ as usize }, 18usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Weird), "::", stringify!(mTextRendering) diff --git a/tests/expectations/tests/whitelist-namespaces.rs b/tests/expectations/tests/whitelist-namespaces.rs index f1c86bde36..bb514f08b3 100644 --- a/tests/expectations/tests/whitelist-namespaces.rs +++ b/tests/expectations/tests/whitelist-namespaces.rs @@ -54,7 +54,7 @@ pub mod root { unsafe { &(*(0 as *const Test)).helper as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(Test), "::", stringify!(helper) diff --git a/tests/expectations/tests/whitelisted-item-references-no-hash.rs b/tests/expectations/tests/whitelisted-item-references-no-hash.rs index 5a77ff75e5..6616957ad4 100644 --- a/tests/expectations/tests/whitelisted-item-references-no-hash.rs +++ b/tests/expectations/tests/whitelisted-item-references-no-hash.rs @@ -43,7 +43,7 @@ fn bindgen_test_layout_WhitelistMe() { unsafe { &(*(0 as *const WhitelistMe)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WhitelistMe), "::", stringify!(a) diff --git a/tests/expectations/tests/whitelisted-item-references-no-partialeq.rs b/tests/expectations/tests/whitelisted-item-references-no-partialeq.rs index 32604b12ff..b85c34de06 100644 --- a/tests/expectations/tests/whitelisted-item-references-no-partialeq.rs +++ b/tests/expectations/tests/whitelisted-item-references-no-partialeq.rs @@ -43,7 +43,7 @@ fn bindgen_test_layout_WhitelistMe() { unsafe { &(*(0 as *const WhitelistMe)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WhitelistMe), "::", stringify!(a) diff --git a/tests/expectations/tests/whitelisted_item_references_no_copy.rs b/tests/expectations/tests/whitelisted_item_references_no_copy.rs index 91b6d46a74..7ce20a295b 100644 --- a/tests/expectations/tests/whitelisted_item_references_no_copy.rs +++ b/tests/expectations/tests/whitelisted_item_references_no_copy.rs @@ -43,7 +43,7 @@ fn bindgen_test_layout_WhitelistMe() { unsafe { &(*(0 as *const WhitelistMe)).a as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(WhitelistMe), "::", stringify!(a) diff --git a/tests/expectations/tests/zero-sized-array.rs b/tests/expectations/tests/zero-sized-array.rs index 15e5bc1f44..0c4620e401 100644 --- a/tests/expectations/tests/zero-sized-array.rs +++ b/tests/expectations/tests/zero-sized-array.rs @@ -63,7 +63,7 @@ fn bindgen_test_layout_ZeroSizedArray() { unsafe { &(*(0 as *const ZeroSizedArray)).arr as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ZeroSizedArray), "::", stringify!(arr) @@ -92,7 +92,7 @@ fn bindgen_test_layout_ContainsZeroSizedArray() { unsafe { &(*(0 as *const ContainsZeroSizedArray)).zsa as *const _ as usize }, 0usize, concat!( - "Alignment of field: ", + "Offset of field: ", stringify!(ContainsZeroSizedArray), "::", stringify!(zsa)