From 9bd603e74131ee734ea24e27fabd8ca082dd4fec Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Tue, 20 Aug 2024 11:28:23 -0500 Subject: [PATCH] Add `#[clippy::allow]` attribute to `const` layout tests --- CHANGELOG.md | 1 + .../expectations/tests/16-byte-alignment.rs | 7 +++++ .../tests/expectations/tests/accessors.rs | 6 +++++ .../expectations/tests/allowlist-file.rs | 4 +++ .../tests/allowlist-namespaces-basic.rs | 1 + .../tests/allowlist-namespaces.rs | 2 ++ .../expectations/tests/allowlist_item.rs | 1 + .../allowlisted-item-references-no-hash.rs | 2 ++ ...llowlisted-item-references-no-partialeq.rs | 2 ++ .../allowlisted_item_references_no_copy.rs | 2 ++ .../expectations/tests/annotation_hide.rs | 2 ++ .../expectations/tests/anon-fields-prefix.rs | 3 +++ .../tests/expectations/tests/anon_enum.rs | 1 + .../expectations/tests/anon_enum_trait.rs | 1 + .../tests/anon_struct_in_union.rs | 3 +++ .../tests/expectations/tests/anon_union.rs | 2 ++ .../tests/array-of-zero-sized-types.rs | 2 ++ .../attribute_warn_unused_result_pre_1_27.rs | 1 + .../tests/expectations/tests/auto.rs | 1 + .../expectations/tests/base-to-derived.rs | 1 + .../tests/bitfield-32bit-overflow.rs | 1 + .../expectations/tests/bitfield-enum-basic.rs | 1 + .../expectations/tests/bitfield-large.rs | 2 ++ .../expectations/tests/bitfield-linux-32.rs | 1 + .../tests/bitfield-method-same-name.rs | 1 + .../expectations/tests/bitfield_align.rs | 6 +++++ .../expectations/tests/bitfield_align_2.rs | 1 + .../tests/bitfield_large_overflow.rs | 1 + .../tests/bitfield_method_mangling.rs | 1 + .../tests/bitfield_pragma_packed.rs | 3 +++ .../tests/blocklist-and-impl-debug.rs | 1 + .../expectations/tests/blocklist-file.rs | 2 ++ .../expectations/tests/blocklist-function.rs | 1 + .../expectations/tests/blocklist-methods.rs | 1 + .../tests/blocklist_bitfield_unit.rs | 1 + .../expectations/tests/blocks-signature.rs | 1 + .../tests/expectations/tests/blocks.rs | 1 + .../tests/expectations/tests/bug-1529681.rs | 1 + .../expectations/tests/c-empty-layout.rs | 1 + .../tests/expectations/tests/c_naming.rs | 2 ++ .../expectations/tests/call-conv-field.rs | 1 + .../expectations/tests/canonical-types.rs | 7 +++++ .../canonical_path_without_namespacing.rs | 1 + .../tests/expectations/tests/char.rs | 1 + .../tests/expectations/tests/class_nested.rs | 5 ++++ .../expectations/tests/class_no_members.rs | 3 +++ .../tests/expectations/tests/class_static.rs | 1 + .../expectations/tests/class_static_const.rs | 1 + .../tests/expectations/tests/class_use_as.rs | 2 ++ .../expectations/tests/class_with_dtor.rs | 2 ++ .../tests/class_with_inner_struct.rs | 11 ++++++++ .../expectations/tests/class_with_typedef.rs | 2 ++ .../expectations/tests/comment-indent.rs | 5 ++++ .../tests/expectations/tests/complex.rs | 4 +++ .../expectations/tests/const-const-mut-ptr.rs | 1 + .../expectations/tests/const_array_typedef.rs | 1 + .../tests/expectations/tests/const_bool.rs | 1 + .../expectations/tests/const_enum_unnamed.rs | 1 + .../tests/constified-enum-module-overflow.rs | 3 +++ .../expectations/tests/constify-all-enums.rs | 1 + .../tests/constify-module-enums-basic.rs | 1 + .../tests/constify-module-enums-namespace.rs | 1 + .../constify-module-enums-shadow-name.rs | 1 + .../constify-module-enums-simple-alias.rs | 1 + ...onstify-module-enums-simple-nonamespace.rs | 1 + .../tests/constify-module-enums-types.rs | 3 +++ .../expectations/tests/constructor-tp.rs | 1 + .../tests/expectations/tests/constructors.rs | 2 ++ .../tests/contains-vs-inherits-zero-sized.rs | 3 +++ .../expectations/tests/convert-floats.rs | 1 + .../expectations/tests/cpp-empty-layout.rs | 1 + .../tests/expectations/tests/crtp.rs | 4 +++ .../expectations/tests/ctypes-prefix-path.rs | 1 + .../tests/default-template-parameter.rs | 1 + .../expectations/tests/deleted-function.rs | 3 +++ .../expectations/tests/derive-custom-cli.rs | 3 +++ .../tests/derive-debug-mangle-name.rs | 2 ++ .../tests/derive-default-and-blocklist.rs | 1 + .../tests/expectations/tests/derive-fn-ptr.rs | 2 ++ .../tests/derive-hash-and-blocklist.rs | 1 + .../tests/derive-hash-blocklisting.rs | 2 ++ ...rive-hash-struct-with-anon-struct-float.rs | 2 ++ .../derive-hash-struct-with-float-array.rs | 1 + ...erive-hash-struct-with-incomplete-array.rs | 3 +++ .../tests/derive-hash-struct-with-pointer.rs | 4 +++ .../tests/derive-hash-template-inst-float.rs | 4 +++ .../tests/derive-partialeq-and-blocklist.rs | 1 + .../tests/derive-partialeq-anonfield.rs | 2 ++ .../tests/derive-partialeq-pointer.rs | 4 +++ .../tests/derive-partialeq-union.rs | 1 + .../tests/disable-nested-struct-naming.rs | 8 ++++++ .../tests/disable-untagged-union.rs | 1 + .../expectations/tests/do-not-derive-copy.rs | 1 + .../tests/expectations/tests/doggo-or-null.rs | 3 +++ .../tests/duplicated-definition-count.rs | 1 + .../duplicated-namespaces-definitions.rs | 2 ++ .../tests/dynamic_loading_with_blocklist.rs | 1 + .../tests/dynamic_loading_with_class.rs | 1 + .../tests/enum-default-bitfield.rs | 1 + .../expectations/tests/enum-default-consts.rs | 1 + .../expectations/tests/enum-default-module.rs | 1 + .../expectations/tests/enum-default-rust.rs | 1 + .../expectations/tests/enum-no-debug-rust.rs | 1 + .../tests/expectations/tests/enum.rs | 1 + .../tests/enum_and_vtable_mangling.rs | 1 + .../expectations/tests/explicit-padding.rs | 2 ++ .../tests/field-visibility-callback.rs | 1 + .../expectations/tests/field-visibility.rs | 2 ++ .../tests/expectations/tests/flexarray.rs | 5 ++++ .../tests/expectations/tests/float16.rs | 2 ++ .../tests/forward-declaration-autoptr.rs | 2 ++ .../tests/forward_declared_complex_types.rs | 2 ++ .../tests/forward_declared_struct.rs | 2 ++ .../expectations/tests/func_ptr_in_struct.rs | 1 + .../tests/func_return_must_use.rs | 2 ++ .../tests/gen-constructors-neg.rs | 1 + .../expectations/tests/gen-constructors.rs | 1 + .../expectations/tests/gen-destructors-neg.rs | 1 + .../expectations/tests/gen-destructors.rs | 1 + .../expectations/tests/generate-inline.rs | 1 + .../tests/incomplete-array-padding.rs | 1 + ...from-template-instantiation-with-vtable.rs | 8 ++++++ .../tests/inherit_multiple_interfaces.rs | 3 +++ .../expectations/tests/inherit_typedef.rs | 2 ++ .../expectations/tests/inline_namespace.rs | 1 + .../tests/inline_namespace_conservative.rs | 1 + .../tests/expectations/tests/inner_const.rs | 1 + .../expectations/tests/inner_template_self.rs | 2 ++ .../tests/expectations/tests/issue-1034.rs | 1 + .../issue-1076-unnamed-bitfield-alignment.rs | 1 + .../tests/issue-1118-using-forward-decl.rs | 4 +++ .../tests/issue-1197-pure-virtual-stuff.rs | 1 + .../tests/issue-1216-variadic-member.rs | 1 + .../tests/expectations/tests/issue-1281.rs | 3 +++ .../tests/expectations/tests/issue-1285.rs | 2 ++ .../tests/issue-1382-rust-primitive-types.rs | 1 + .../tests/expectations/tests/issue-1443.rs | 4 +++ .../tests/expectations/tests/issue-1454.rs | 1 + .../tests/expectations/tests/issue-1498.rs | 2 ++ .../tests/expectations/tests/issue-1947.rs | 1 + .../tests/issue-1977-larger-arrays.rs | 1 + .../tests/expectations/tests/issue-1995.rs | 1 + .../tests/expectations/tests/issue-2019.rs | 2 ++ .../tests/expectations/tests/issue-2556.rs | 1 + .../tests/expectations/tests/issue-2695.rs | 1 + .../tests/expectations/tests/issue-410.rs | 1 + .../tests/expectations/tests/issue-447.rs | 2 ++ .../tests/expectations/tests/issue-537.rs | 4 +++ ...ate-params-causing-layout-test-failures.rs | 2 ++ .../tests/issue-573-layout-test-failures.rs | 2 ++ .../issue-574-assertion-failure-in-codegen.rs | 2 ++ ...issue-584-stylo-template-analysis-panic.rs | 4 +++ .../tests/issue-639-typedef-anon-field.rs | 4 +++ .../tests/issue-643-inner-struct.rs | 3 +++ .../tests/expectations/tests/issue-674-1.rs | 1 + .../tests/expectations/tests/issue-674-2.rs | 3 +++ .../tests/expectations/tests/issue-674-3.rs | 2 ++ .../issue-691-template-parameter-virtual.rs | 3 +++ .../tests/issue-739-pointer-wide-bitfield.rs | 1 + .../tests/issue-769-bad-instantiation-test.rs | 2 ++ .../tests/issue-801-opaque-sloppiness.rs | 2 ++ ...07-opaque-types-methods-being-generated.rs | 5 ++++ .../tests/expectations/tests/issue-816.rs | 1 + ...26-generating-methods-when-asked-not-to.rs | 1 + .../tests/expectations/tests/issue-834.rs | 1 + .../tests/issue-888-enum-var-decl-jump.rs | 1 + .../issue-944-derive-copy-and-blocklisting.rs | 1 + .../tests/expectations/tests/issue-946.rs | 1 + .../tests/expectations/tests/issue_311.rs | 2 ++ .../expectations/tests/jsval_layout_opaque.rs | 5 ++++ .../tests/expectations/tests/layout_align.rs | 2 ++ .../tests/expectations/tests/layout_arp.rs | 3 +++ .../tests/layout_cmdline_token.rs | 4 +++ .../tests/expectations/tests/layout_mbuf.rs | 13 ++++++++++ .../constified-enum-module-overflow.rs | 2 ++ .../libclang-9/ptr32-has-different-size.rs | 1 + .../tests/libclang-9/struct_typedef_ns.rs | 2 ++ .../expectations/tests/mangling-linux32.rs | 1 + .../expectations/tests/mangling-linux64.rs | 1 + .../expectations/tests/mangling-macos.rs | 1 + .../expectations/tests/mangling-win32.rs | 1 + .../expectations/tests/mangling-win64.rs | 1 + .../expectations/tests/merge-extern-blocks.rs | 2 ++ .../expectations/tests/method-mangling.rs | 1 + .../expectations/tests/module-allowlisted.rs | 1 + .../tests/expectations/tests/msvc-no-usr.rs | 1 + .../multiple-inherit-empty-correct-layout.rs | 3 +++ .../tests/expectations/tests/mutable.rs | 3 +++ .../tests/expectations/tests/namespace.rs | 1 + .../tests/expectations/tests/nested.rs | 4 +++ .../tests/expectations/tests/nested_vtable.rs | 3 +++ .../tests/nested_within_namespace.rs | 3 +++ .../tests/expectations/tests/no-comments.rs | 1 + .../expectations/tests/no-derive-debug.rs | 1 + .../expectations/tests/no-derive-default.rs | 1 + .../expectations/tests/no-hash-allowlisted.rs | 1 + .../expectations/tests/no-hash-opaque.rs | 1 + .../tests/no-partialeq-allowlisted.rs | 1 + .../expectations/tests/no-partialeq-opaque.rs | 1 + .../tests/no-recursive-allowlisting.rs | 1 + .../tests/expectations/tests/no-std.rs | 1 + .../expectations/tests/no_copy_allowlisted.rs | 1 + .../expectations/tests/no_copy_opaque.rs | 1 + .../tests/no_debug_allowlisted.rs | 1 + .../expectations/tests/no_debug_opaque.rs | 1 + .../tests/no_default_allowlisted.rs | 1 + .../expectations/tests/no_default_opaque.rs | 1 + .../expectations/tests/no_size_t_is_usize.rs | 1 + .../expectations/tests/non-type-params.rs | 1 + .../expectations/tests/objc_interface_type.rs | 1 + .../expectations/tests/only_bitfields.rs | 1 + .../tests/opaque-template-inst-member-2.rs | 2 ++ ...paque-template-instantiation-namespaced.rs | 5 ++++ .../tests/opaque-template-instantiation.rs | 3 +++ .../expectations/tests/opaque-tracing.rs | 1 + .../expectations/tests/opaque_in_struct.rs | 2 ++ .../expectations/tests/opaque_pointer.rs | 2 ++ .../expectations/tests/packed-bitfield.rs | 1 + .../tests/packed-n-with-padding.rs | 1 + .../tests/expectations/tests/parm-union.rs | 1 + .../partial-specialization-and-inheritance.rs | 1 + .../tests/expectations/tests/private.rs | 3 +++ .../expectations/tests/private_fields.rs | 13 ++++++++++ .../tests/ptr32-has-different-size.rs | 1 + .../tests/expectations/tests/public-dtor.rs | 2 ++ .../tests/redundant-packed-and-align.rs | 6 +++++ .../expectations/tests/ref_argument_array.rs | 1 + .../tests/reparented_replacement.rs | 1 + .../tests/expectations/tests/replace_use.rs | 2 ++ ...ame_struct_name_in_different_namespaces.rs | 1 + .../tests/sentry-defined-multiple-times.rs | 12 +++++++++ .../expectations/tests/size_t_template.rs | 1 + .../tests/expectations/tests/sorted_items.rs | 4 +++ .../expectations/tests/stdint_typedef.rs | 1 + ...ruct_containing_forward_declared_struct.rs | 2 ++ .../expectations/tests/struct_typedef.rs | 2 ++ .../expectations/tests/struct_typedef_ns.rs | 2 ++ .../tests/struct_with_anon_struct.rs | 2 ++ .../tests/struct_with_anon_struct_array.rs | 3 +++ .../tests/struct_with_anon_struct_pointer.rs | 2 ++ .../tests/struct_with_anon_union.rs | 2 ++ .../tests/struct_with_anon_unnamed_struct.rs | 2 ++ .../tests/struct_with_anon_unnamed_union.rs | 2 ++ .../tests/struct_with_bitfields.rs | 1 + .../expectations/tests/struct_with_nesting.rs | 4 +++ .../expectations/tests/struct_with_packing.rs | 1 + .../expectations/tests/struct_with_struct.rs | 2 ++ .../tests/expectations/tests/template.rs | 26 +++++++++++++++++++ ...mplate_instantiation_with_fn_local_type.rs | 5 ++++ .../test_mixed_header_and_header_contents.rs | 1 + .../test_multiple_header_calls_in_builder.rs | 1 + .../tests/expectations/tests/timex.rs | 2 ++ ...type-referenced-by-allowlisted-function.rs | 1 + .../tests/type_alias_template_specialized.rs | 2 ++ .../tests/typedef-pointer-overlap.rs | 3 +++ .../tests/expectations/tests/typeref.rs | 5 ++++ .../tests/expectations/tests/underscore.rs | 1 + .../tests/expectations/tests/union-in-ns.rs | 1 + .../expectations/tests/union_bitfield.rs | 2 ++ .../tests/expectations/tests/union_dtor.rs | 1 + .../tests/expectations/tests/union_fields.rs | 1 + .../tests/union_with_anon_struct.rs | 2 ++ .../tests/union_with_anon_struct_bitfield.rs | 2 ++ .../tests/union_with_anon_union.rs | 2 ++ .../tests/union_with_anon_unnamed_struct.rs | 2 ++ .../tests/union_with_anon_unnamed_union.rs | 2 ++ .../tests/union_with_big_member.rs | 3 +++ .../expectations/tests/union_with_nesting.rs | 4 +++ .../tests/union_with_non_copy_member.rs | 4 +++ .../tests/expectations/tests/unknown_attr.rs | 1 + .../expectations/tests/unsorted-items.rs | 2 ++ .../tests/expectations/tests/use-core.rs | 2 ++ .../tests/expectations/tests/var-tracing.rs | 2 ++ .../expectations/tests/variadic-method.rs | 1 + .../tests/expectations/tests/vector.rs | 1 + .../tests/expectations/tests/virtual_dtor.rs | 1 + .../expectations/tests/virtual_interface.rs | 4 +++ .../expectations/tests/virtual_overloaded.rs | 1 + .../tests/vtable_recursive_sig.rs | 2 ++ .../tests/wasm-constructor-returns.rs | 1 + .../expectations/tests/weird_bitfields.rs | 1 + .../expectations/tests/what_is_going_on.rs | 1 + .../tests/win32-thiscall_nightly.rs | 1 + .../tests/zero-size-array-align.rs | 1 + .../expectations/tests/zero-sized-array.rs | 5 ++++ bindgen/codegen/mod.rs | 2 ++ 286 files changed, 610 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d80fa4fa81..9bcb0eec6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -212,6 +212,7 @@ ## Changed ## Removed ## Fixed +- Fix regression where the `const` layout tests were triggering the `unnecessary_operation` and `identity_op` clippy warnings. ## Security # 0.70.0 (2024-08-16) diff --git a/bindgen-tests/tests/expectations/tests/16-byte-alignment.rs b/bindgen-tests/tests/expectations/tests/16-byte-alignment.rs index 8eb78eaf6c..c55d0b075b 100644 --- a/bindgen-tests/tests/expectations/tests/16-byte-alignment.rs +++ b/bindgen-tests/tests/expectations/tests/16-byte-alignment.rs @@ -18,6 +18,7 @@ pub struct rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 { pub dport: u16, pub sport: u16, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1", @@ -34,6 +35,7 @@ const _: () = { ][::std::mem::offset_of!(rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1, sport) - 2usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_ipv4_tuple__bindgen_ty_1", @@ -54,6 +56,7 @@ impl Default for rte_ipv4_tuple__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_ipv4_tuple"][::std::mem::size_of::() - 12usize]; ["Alignment of rte_ipv4_tuple"][::std::mem::align_of::() - 4usize]; @@ -92,6 +95,7 @@ pub struct rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 { pub dport: u16, pub sport: u16, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1", @@ -108,6 +112,7 @@ const _: () = { ][::std::mem::offset_of!(rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1, sport) - 2usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_ipv6_tuple__bindgen_ty_1", @@ -128,6 +133,7 @@ impl Default for rte_ipv6_tuple__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_ipv6_tuple"][::std::mem::size_of::() - 36usize]; ["Alignment of rte_ipv6_tuple"][::std::mem::align_of::() - 4usize]; @@ -154,6 +160,7 @@ pub union rte_thash_tuple { pub v4: rte_ipv4_tuple, pub v6: rte_ipv6_tuple, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_thash_tuple"][::std::mem::size_of::() - 48usize]; [ diff --git a/bindgen-tests/tests/expectations/tests/accessors.rs b/bindgen-tests/tests/expectations/tests/accessors.rs index 0bd4d8169d..586edf2d79 100644 --- a/bindgen-tests/tests/expectations/tests/accessors.rs +++ b/bindgen-tests/tests/expectations/tests/accessors.rs @@ -10,6 +10,7 @@ pub struct SomeAccessors { ///
pub mImmutableAccessor: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of SomeAccessors"][::std::mem::size_of::() - 16usize]; ["Alignment of SomeAccessors"][::std::mem::align_of::() - 4usize]; @@ -55,6 +56,7 @@ pub struct AllAccessors { pub mBothAccessors: ::std::os::raw::c_int, pub mAlsoBothAccessors: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AllAccessors"][::std::mem::size_of::() - 8usize]; ["Alignment of AllAccessors"][::std::mem::align_of::() - 4usize]; @@ -90,6 +92,7 @@ pub struct AllUnsafeAccessors { pub mBothAccessors: ::std::os::raw::c_int, pub mAlsoBothAccessors: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AllUnsafeAccessors"][::std::mem::size_of::() - 8usize]; [ @@ -132,6 +135,7 @@ pub struct ContradictAccessors { ///
pub mImmutableAccessor: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ContradictAccessors", @@ -180,6 +184,7 @@ impl ContradictAccessors { pub struct Replaced { pub mAccessor: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Replaced"][::std::mem::size_of::() - 4usize]; ["Alignment of Replaced"][::std::mem::align_of::() - 4usize]; @@ -203,6 +208,7 @@ impl Replaced { pub struct Wrapper { pub mReplaced: Replaced, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Wrapper"][::std::mem::size_of::() - 4usize]; ["Alignment of Wrapper"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/allowlist-file.rs b/bindgen-tests/tests/expectations/tests/allowlist-file.rs index cb2aa01c59..a0053653f3 100644 --- a/bindgen-tests/tests/expectations/tests/allowlist-file.rs +++ b/bindgen-tests/tests/expectations/tests/allowlist-file.rs @@ -12,6 +12,7 @@ extern "C" { pub struct someClass { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of someClass"][::std::mem::size_of::() - 1usize]; ["Alignment of someClass"][::std::mem::align_of::() - 1usize]; @@ -38,6 +39,7 @@ extern "C" { pub struct StructWithAllowlistedDefinition { pub other: *mut StructWithAllowlistedFwdDecl, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of StructWithAllowlistedDefinition", @@ -63,6 +65,7 @@ impl Default for StructWithAllowlistedDefinition { pub struct StructWithAllowlistedFwdDecl { pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of StructWithAllowlistedFwdDecl", @@ -79,6 +82,7 @@ const _: () = { pub struct AllowlistMe { pub foo: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AllowlistMe"][::std::mem::size_of::() - 4usize]; ["Alignment of AllowlistMe"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/allowlist-namespaces-basic.rs b/bindgen-tests/tests/expectations/tests/allowlist-namespaces-basic.rs index be6fac2117..151d03f4a4 100644 --- a/bindgen-tests/tests/expectations/tests/allowlist-namespaces-basic.rs +++ b/bindgen-tests/tests/expectations/tests/allowlist-namespaces-basic.rs @@ -14,6 +14,7 @@ pub mod root { pub struct Helper { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Helper"][::std::mem::size_of::() - 1usize]; ["Alignment of Helper"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/allowlist-namespaces.rs b/bindgen-tests/tests/expectations/tests/allowlist-namespaces.rs index 1c7078504f..563c97ca1d 100644 --- a/bindgen-tests/tests/expectations/tests/allowlist-namespaces.rs +++ b/bindgen-tests/tests/expectations/tests/allowlist-namespaces.rs @@ -14,6 +14,7 @@ pub mod root { pub struct Helper { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Helper"][::std::mem::size_of::() - 1usize]; ["Alignment of Helper"][::std::mem::align_of::() - 1usize]; @@ -24,6 +25,7 @@ pub mod root { pub struct Test { pub helper: root::outer::inner::Helper, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test"][::std::mem::size_of::() - 1usize]; ["Alignment of Test"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/allowlist_item.rs b/bindgen-tests/tests/expectations/tests/allowlist_item.rs index f816f5170b..e5aa4b2172 100644 --- a/bindgen-tests/tests/expectations/tests/allowlist_item.rs +++ b/bindgen-tests/tests/expectations/tests/allowlist_item.rs @@ -5,6 +5,7 @@ pub const FooDefault: u32 = 0; pub struct Foo { pub field: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 4usize]; ["Alignment of Foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/allowlisted-item-references-no-hash.rs b/bindgen-tests/tests/expectations/tests/allowlisted-item-references-no-hash.rs index ce1d463f57..6c1d13a837 100644 --- a/bindgen-tests/tests/expectations/tests/allowlisted-item-references-no-hash.rs +++ b/bindgen-tests/tests/expectations/tests/allowlisted-item-references-no-hash.rs @@ -4,6 +4,7 @@ pub struct NoHash { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoHash"][::std::mem::size_of::() - 1usize]; ["Alignment of NoHash"][::std::mem::align_of::() - 1usize]; @@ -13,6 +14,7 @@ const _: () = { pub struct AllowlistMe { pub a: NoHash, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AllowlistMe"][::std::mem::size_of::() - 1usize]; ["Alignment of AllowlistMe"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/allowlisted-item-references-no-partialeq.rs b/bindgen-tests/tests/expectations/tests/allowlisted-item-references-no-partialeq.rs index 2b699f61db..b969727dbb 100644 --- a/bindgen-tests/tests/expectations/tests/allowlisted-item-references-no-partialeq.rs +++ b/bindgen-tests/tests/expectations/tests/allowlisted-item-references-no-partialeq.rs @@ -4,6 +4,7 @@ pub struct NoPartialEq { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoPartialEq"][::std::mem::size_of::() - 1usize]; ["Alignment of NoPartialEq"][::std::mem::align_of::() - 1usize]; @@ -13,6 +14,7 @@ const _: () = { pub struct AllowlistMe { pub a: NoPartialEq, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AllowlistMe"][::std::mem::size_of::() - 1usize]; ["Alignment of AllowlistMe"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/allowlisted_item_references_no_copy.rs b/bindgen-tests/tests/expectations/tests/allowlisted_item_references_no_copy.rs index cbcce1ef44..8c671b4e84 100644 --- a/bindgen-tests/tests/expectations/tests/allowlisted_item_references_no_copy.rs +++ b/bindgen-tests/tests/expectations/tests/allowlisted_item_references_no_copy.rs @@ -4,6 +4,7 @@ pub struct NoCopy { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoCopy"][::std::mem::size_of::() - 1usize]; ["Alignment of NoCopy"][::std::mem::align_of::() - 1usize]; @@ -13,6 +14,7 @@ const _: () = { pub struct AllowlistMe { pub a: NoCopy, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AllowlistMe"][::std::mem::size_of::() - 1usize]; ["Alignment of AllowlistMe"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/annotation_hide.rs b/bindgen-tests/tests/expectations/tests/annotation_hide.rs index 0343c92272..e79c88214d 100644 --- a/bindgen-tests/tests/expectations/tests/annotation_hide.rs +++ b/bindgen-tests/tests/expectations/tests/annotation_hide.rs @@ -6,6 +6,7 @@ pub struct D { pub _bindgen_opaque_blob: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of D"][::std::mem::size_of::() - 4usize]; ["Alignment of D"][::std::mem::align_of::() - 4usize]; @@ -15,6 +16,7 @@ const _: () = { pub struct NotAnnotated { pub f: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NotAnnotated"][::std::mem::size_of::() - 4usize]; ["Alignment of NotAnnotated"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/anon-fields-prefix.rs b/bindgen-tests/tests/expectations/tests/anon-fields-prefix.rs index c408a08b0c..2b96804c9b 100644 --- a/bindgen-tests/tests/expectations/tests/anon-fields-prefix.rs +++ b/bindgen-tests/tests/expectations/tests/anon-fields-prefix.rs @@ -13,6 +13,7 @@ pub struct color__bindgen_ty_1 { pub g: ::std::os::raw::c_uchar, pub b: ::std::os::raw::c_uchar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of color__bindgen_ty_1", @@ -37,6 +38,7 @@ pub struct color__bindgen_ty_2 { pub u: ::std::os::raw::c_uchar, pub v: ::std::os::raw::c_uchar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of color__bindgen_ty_2", @@ -54,6 +56,7 @@ const _: () = { "Offset of field: color__bindgen_ty_2::v", ][::std::mem::offset_of!(color__bindgen_ty_2, v) - 2usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of color"][::std::mem::size_of::() - 3usize]; ["Alignment of color"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/anon_enum.rs b/bindgen-tests/tests/expectations/tests/anon_enum.rs index 5324e499e4..c3790a2a24 100644 --- a/bindgen-tests/tests/expectations/tests/anon_enum.rs +++ b/bindgen-tests/tests/expectations/tests/anon_enum.rs @@ -11,6 +11,7 @@ pub const Test_T_NONE: Test__bindgen_ty_1 = Test__bindgen_ty_1::T_NONE; pub enum Test__bindgen_ty_1 { T_NONE = 0, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test"][::std::mem::size_of::() - 8usize]; ["Alignment of Test"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/anon_enum_trait.rs b/bindgen-tests/tests/expectations/tests/anon_enum_trait.rs index 97d97d6afd..cfd4d03200 100644 --- a/bindgen-tests/tests/expectations/tests/anon_enum_trait.rs +++ b/bindgen-tests/tests/expectations/tests/anon_enum_trait.rs @@ -30,6 +30,7 @@ pub const Foo_Baz: Foo__bindgen_ty_1 = Foo__bindgen_ty_1::Bar; pub enum Foo__bindgen_ty_1 { Bar = 0, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/anon_struct_in_union.rs b/bindgen-tests/tests/expectations/tests/anon_struct_in_union.rs index dc61f38911..dceca1adf3 100644 --- a/bindgen-tests/tests/expectations/tests/anon_struct_in_union.rs +++ b/bindgen-tests/tests/expectations/tests/anon_struct_in_union.rs @@ -14,6 +14,7 @@ pub union s__bindgen_ty_1 { pub struct s__bindgen_ty_1_inner { pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of s__bindgen_ty_1_inner", @@ -25,6 +26,7 @@ const _: () = { "Offset of field: s__bindgen_ty_1_inner::b", ][::std::mem::offset_of!(s__bindgen_ty_1_inner, b) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of s__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; ["Alignment of s__bindgen_ty_1"][::std::mem::align_of::() - 4usize]; @@ -41,6 +43,7 @@ impl Default for s__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of s"][::std::mem::size_of::() - 4usize]; ["Alignment of s"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/anon_union.rs b/bindgen-tests/tests/expectations/tests/anon_union.rs index caf5f93ece..d9bf3cf183 100644 --- a/bindgen-tests/tests/expectations/tests/anon_union.rs +++ b/bindgen-tests/tests/expectations/tests/anon_union.rs @@ -51,6 +51,7 @@ impl Default for TErrorResult { pub struct ErrorResult { pub _base: TErrorResult, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ErrorResult"][::std::mem::size_of::() - 24usize]; ["Alignment of ErrorResult"][::std::mem::align_of::() - 8usize]; @@ -64,6 +65,7 @@ impl Default for ErrorResult { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: TErrorResult_open0_int_close0", diff --git a/bindgen-tests/tests/expectations/tests/array-of-zero-sized-types.rs b/bindgen-tests/tests/expectations/tests/array-of-zero-sized-types.rs index 3477e83dc2..4630abd275 100644 --- a/bindgen-tests/tests/expectations/tests/array-of-zero-sized-types.rs +++ b/bindgen-tests/tests/expectations/tests/array-of-zero-sized-types.rs @@ -5,6 +5,7 @@ pub struct Empty { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Empty"][::std::mem::size_of::() - 1usize]; ["Alignment of Empty"][::std::mem::align_of::() - 1usize]; @@ -16,6 +17,7 @@ const _: () = { pub struct HasArrayOfEmpty { pub empties: [Empty; 10usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of HasArrayOfEmpty"][::std::mem::size_of::() - 10usize]; ["Alignment of HasArrayOfEmpty"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_pre_1_27.rs b/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_pre_1_27.rs index 92f6eaf97d..f545f9e6bb 100644 --- a/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_pre_1_27.rs +++ b/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_pre_1_27.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/auto.rs b/bindgen-tests/tests/expectations/tests/auto.rs index 2ee0ebbaff..0173f0409f 100644 --- a/bindgen-tests/tests/expectations/tests/auto.rs +++ b/bindgen-tests/tests/expectations/tests/auto.rs @@ -5,6 +5,7 @@ pub struct Foo { pub _address: u8, } pub const Foo_kFoo: bool = true; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/base-to-derived.rs b/bindgen-tests/tests/expectations/tests/base-to-derived.rs index 26d8d799ba..22ef4fdb08 100644 --- a/bindgen-tests/tests/expectations/tests/base-to-derived.rs +++ b/bindgen-tests/tests/expectations/tests/base-to-derived.rs @@ -4,6 +4,7 @@ pub struct false_type { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of false_type"][::std::mem::size_of::() - 1usize]; ["Alignment of false_type"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/bitfield-32bit-overflow.rs b/bindgen-tests/tests/expectations/tests/bitfield-32bit-overflow.rs index 9e365e48ef..475cbae837 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield-32bit-overflow.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield-32bit-overflow.rs @@ -89,6 +89,7 @@ pub struct MuchBitfield { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 5usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of MuchBitfield"][::std::mem::size_of::() - 5usize]; ["Alignment of MuchBitfield"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/bitfield-enum-basic.rs b/bindgen-tests/tests/expectations/tests/bitfield-enum-basic.rs index 9775f07c60..adc4690c86 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield-enum-basic.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield-enum-basic.rs @@ -148,6 +148,7 @@ impl ::std::ops::BitAndAssign for Dummy__bindgen_ty_1 { #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Dummy__bindgen_ty_1(pub ::std::os::raw::c_uint); +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Dummy"][::std::mem::size_of::() - 1usize]; ["Alignment of Dummy"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/bitfield-large.rs b/bindgen-tests/tests/expectations/tests/bitfield-large.rs index 44f9e5b765..27118083d5 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield-large.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield-large.rs @@ -90,6 +90,7 @@ pub struct HasBigBitfield { pub _bitfield_align_1: [u64; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of HasBigBitfield"][::std::mem::size_of::() - 16usize]; ["Alignment of HasBigBitfield"][::std::mem::align_of::() - 16usize]; @@ -128,6 +129,7 @@ pub struct HasTwoBigBitfields { pub _bitfield_align_1: [u64; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of HasTwoBigBitfields", diff --git a/bindgen-tests/tests/expectations/tests/bitfield-linux-32.rs b/bindgen-tests/tests/expectations/tests/bitfield-linux-32.rs index ffd5e61cb5..9e69bf9de5 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield-linux-32.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield-linux-32.rs @@ -90,6 +90,7 @@ pub struct Test { pub _bitfield_align_1: [u64; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test"][::std::mem::size_of::() - 16usize]; ["Alignment of Test"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/bitfield-method-same-name.rs b/bindgen-tests/tests/expectations/tests/bitfield-method-same-name.rs index ea8618280f..dd4286496c 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield-method-same-name.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield-method-same-name.rs @@ -89,6 +89,7 @@ pub struct Foo { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/bitfield_align.rs b/bindgen-tests/tests/expectations/tests/bitfield_align.rs index dc0cc52183..828f176de9 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield_align.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield_align.rs @@ -92,6 +92,7 @@ pub struct A { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, pub y: ::std::os::raw::c_uchar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 4usize]; ["Alignment of A"][::std::mem::align_of::() - 4usize]; @@ -322,6 +323,7 @@ pub struct B { pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of B"][::std::mem::size_of::() - 4usize]; ["Alignment of B"][::std::mem::align_of::() - 4usize]; @@ -384,6 +386,7 @@ pub struct C { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub baz: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 8usize]; ["Alignment of C"][::std::mem::align_of::() - 4usize]; @@ -448,6 +451,7 @@ pub struct Date1 { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, pub __bindgen_padding_0: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Date1"][::std::mem::size_of::() - 4usize]; ["Alignment of Date1"][::std::mem::align_of::() - 2usize]; @@ -551,6 +555,7 @@ pub struct Date2 { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Date2"][::std::mem::size_of::() - 4usize]; ["Alignment of Date2"][::std::mem::align_of::() - 2usize]; @@ -676,6 +681,7 @@ pub struct Date3 { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, pub byte: ::std::os::raw::c_uchar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Date3"][::std::mem::size_of::() - 4usize]; ["Alignment of Date3"][::std::mem::align_of::() - 2usize]; diff --git a/bindgen-tests/tests/expectations/tests/bitfield_align_2.rs b/bindgen-tests/tests/expectations/tests/bitfield_align_2.rs index 4cb0aaa48c..b87af0c99c 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield_align_2.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield_align_2.rs @@ -98,6 +98,7 @@ pub struct TaggedPtr { pub _bitfield_align_1: [u64; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of TaggedPtr"][::std::mem::size_of::() - 8usize]; ["Alignment of TaggedPtr"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/bitfield_large_overflow.rs b/bindgen-tests/tests/expectations/tests/bitfield_large_overflow.rs index 3040e3e47c..8967bb9856 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield_large_overflow.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield_large_overflow.rs @@ -5,6 +5,7 @@ pub struct _bindgen_ty_1 { pub _bindgen_opaque_blob: [u64; 10usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _bindgen_ty_1"][::std::mem::size_of::<_bindgen_ty_1>() - 80usize]; ["Alignment of _bindgen_ty_1"][::std::mem::align_of::<_bindgen_ty_1>() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/bitfield_method_mangling.rs b/bindgen-tests/tests/expectations/tests/bitfield_method_mangling.rs index 19e415e2c6..b6fe8a5257 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield_method_mangling.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield_method_mangling.rs @@ -89,6 +89,7 @@ pub struct mach_msg_type_descriptor_t { pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of mach_msg_type_descriptor_t", diff --git a/bindgen-tests/tests/expectations/tests/bitfield_pragma_packed.rs b/bindgen-tests/tests/expectations/tests/bitfield_pragma_packed.rs index 54cf2ff1d0..60cf6b8056 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield_pragma_packed.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield_pragma_packed.rs @@ -89,6 +89,7 @@ pub struct Struct { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Struct"][::std::mem::size_of::() - 4usize]; ["Alignment of Struct"][::std::mem::align_of::() - 1usize]; @@ -212,6 +213,7 @@ pub struct Inner { pub _bitfield_align_1: [u16; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Inner"][::std::mem::size_of::() - 4usize]; ["Alignment of Inner"][::std::mem::align_of::() - 2usize]; @@ -271,6 +273,7 @@ impl Inner { pub struct Outer { pub inner: Inner, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Outer"][::std::mem::size_of::() - 4usize]; ["Alignment of Outer"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/blocklist-and-impl-debug.rs b/bindgen-tests/tests/expectations/tests/blocklist-and-impl-debug.rs index e77967c930..43e645bfc3 100644 --- a/bindgen-tests/tests/expectations/tests/blocklist-and-impl-debug.rs +++ b/bindgen-tests/tests/expectations/tests/blocklist-and-impl-debug.rs @@ -5,6 +5,7 @@ pub struct BlocklistMe(u8); pub struct ShouldManuallyImplDebug { pub a: BlocklistMe, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ShouldManuallyImplDebug", diff --git a/bindgen-tests/tests/expectations/tests/blocklist-file.rs b/bindgen-tests/tests/expectations/tests/blocklist-file.rs index 834db1834d..4056ef4d2c 100644 --- a/bindgen-tests/tests/expectations/tests/blocklist-file.rs +++ b/bindgen-tests/tests/expectations/tests/blocklist-file.rs @@ -6,6 +6,7 @@ pub struct SizedIntegers { pub y: u16, pub z: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of SizedIntegers"][::std::mem::size_of::() - 8usize]; ["Alignment of SizedIntegers"][::std::mem::align_of::() - 4usize]; @@ -24,6 +25,7 @@ const _: () = { pub struct StructWithBlocklistedFwdDecl { pub b: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of StructWithBlocklistedFwdDecl", diff --git a/bindgen-tests/tests/expectations/tests/blocklist-function.rs b/bindgen-tests/tests/expectations/tests/blocklist-function.rs index 2d0ab9d573..2e12a01e9e 100644 --- a/bindgen-tests/tests/expectations/tests/blocklist-function.rs +++ b/bindgen-tests/tests/expectations/tests/blocklist-function.rs @@ -20,6 +20,7 @@ pub mod root { pub struct C { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 1usize]; ["Alignment of C"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/blocklist-methods.rs b/bindgen-tests/tests/expectations/tests/blocklist-methods.rs index 835b1fd385..37bb95492d 100644 --- a/bindgen-tests/tests/expectations/tests/blocklist-methods.rs +++ b/bindgen-tests/tests/expectations/tests/blocklist-methods.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/blocklist_bitfield_unit.rs b/bindgen-tests/tests/expectations/tests/blocklist_bitfield_unit.rs index d802e28253..b5737a8d99 100644 --- a/bindgen-tests/tests/expectations/tests/blocklist_bitfield_unit.rs +++ b/bindgen-tests/tests/expectations/tests/blocklist_bitfield_unit.rs @@ -10,6 +10,7 @@ pub struct C { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub baz: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 8usize]; ["Alignment of C"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/blocks-signature.rs b/bindgen-tests/tests/expectations/tests/blocks-signature.rs index be5eed7d19..b1615839ca 100644 --- a/bindgen-tests/tests/expectations/tests/blocks-signature.rs +++ b/bindgen-tests/tests/expectations/tests/blocks-signature.rs @@ -28,6 +28,7 @@ pub struct contains_block_pointers { pub val: contains_block_pointers__bindgen_ty_id_61, pub ptr_val: *mut _bindgen_ty_id_68, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of contains_block_pointers", diff --git a/bindgen-tests/tests/expectations/tests/blocks.rs b/bindgen-tests/tests/expectations/tests/blocks.rs index 1d79678292..ea15d22464 100644 --- a/bindgen-tests/tests/expectations/tests/blocks.rs +++ b/bindgen-tests/tests/expectations/tests/blocks.rs @@ -27,6 +27,7 @@ pub struct contains_block_pointers { pub val: *mut ::std::os::raw::c_void, pub ptr_val: *mut *mut ::std::os::raw::c_void, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of contains_block_pointers", diff --git a/bindgen-tests/tests/expectations/tests/bug-1529681.rs b/bindgen-tests/tests/expectations/tests/bug-1529681.rs index 2681c36faf..bd59c1971f 100644 --- a/bindgen-tests/tests/expectations/tests/bug-1529681.rs +++ b/bindgen-tests/tests/expectations/tests/bug-1529681.rs @@ -4,6 +4,7 @@ pub struct BrowsingContext { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of BrowsingContext"][::std::mem::size_of::() - 1usize]; ["Alignment of BrowsingContext"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/c-empty-layout.rs b/bindgen-tests/tests/expectations/tests/c-empty-layout.rs index e82d70cea1..709a9a59d8 100644 --- a/bindgen-tests/tests/expectations/tests/c-empty-layout.rs +++ b/bindgen-tests/tests/expectations/tests/c-empty-layout.rs @@ -2,6 +2,7 @@ #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct Foo {} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 0usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/c_naming.rs b/bindgen-tests/tests/expectations/tests/c_naming.rs index 83ccbeadcf..502c4486eb 100644 --- a/bindgen-tests/tests/expectations/tests/c_naming.rs +++ b/bindgen-tests/tests/expectations/tests/c_naming.rs @@ -4,6 +4,7 @@ pub struct struct_a { pub a: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of struct_a"][::std::mem::size_of::() - 4usize]; ["Alignment of struct_a"][::std::mem::align_of::() - 4usize]; @@ -16,6 +17,7 @@ pub union union_b { pub a: ::std::os::raw::c_int, pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of union_b"][::std::mem::size_of::() - 4usize]; ["Alignment of union_b"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/call-conv-field.rs b/bindgen-tests/tests/expectations/tests/call-conv-field.rs index 73fc76e208..089b34b134 100644 --- a/bindgen-tests/tests/expectations/tests/call-conv-field.rs +++ b/bindgen-tests/tests/expectations/tests/call-conv-field.rs @@ -10,6 +10,7 @@ pub struct JNINativeInterface_ { >, pub __hack: ::std::os::raw::c_ulonglong, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of JNINativeInterface_", diff --git a/bindgen-tests/tests/expectations/tests/canonical-types.rs b/bindgen-tests/tests/expectations/tests/canonical-types.rs index a6e22c7788..81d2e488a2 100644 --- a/bindgen-tests/tests/expectations/tests/canonical-types.rs +++ b/bindgen-tests/tests/expectations/tests/canonical-types.rs @@ -76,6 +76,7 @@ impl Default for ClassC_ClassCInnerCRTP { pub struct ClassD { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ClassD"][::std::mem::size_of::() - 1usize]; ["Alignment of ClassD"][::std::mem::align_of::() - 1usize]; @@ -89,6 +90,7 @@ impl Default for ClassD { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: ClassB_open0_ClassD_ClassCInnerCRTP_close0", @@ -102,6 +104,7 @@ const _: () = { pub struct ClassCInnerCRTP { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ClassCInnerCRTP"][::std::mem::size_of::() - 1usize]; ["Alignment of ClassCInnerCRTP"][::std::mem::align_of::() - 1usize]; @@ -115,6 +118,7 @@ impl Default for ClassCInnerCRTP { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: ClassB_open0_ClassCInnerCRTP_ClassAInner_close0", @@ -128,6 +132,7 @@ const _: () = { pub struct ClassAInner { pub x: *mut ClassCInnerA, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ClassAInner"][::std::mem::size_of::() - 8usize]; ["Alignment of ClassAInner"][::std::mem::align_of::() - 8usize]; @@ -147,6 +152,7 @@ impl Default for ClassAInner { pub struct ClassCInnerA { pub member: *mut ClassCInnerB, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ClassCInnerA"][::std::mem::size_of::() - 8usize]; ["Alignment of ClassCInnerA"][::std::mem::align_of::() - 8usize]; @@ -168,6 +174,7 @@ impl Default for ClassCInnerA { pub struct ClassCInnerB { pub cache: *mut ClassCInnerA, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ClassCInnerB"][::std::mem::size_of::() - 8usize]; ["Alignment of ClassCInnerB"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/canonical_path_without_namespacing.rs b/bindgen-tests/tests/expectations/tests/canonical_path_without_namespacing.rs index 6882c57fa4..d07751a8db 100644 --- a/bindgen-tests/tests/expectations/tests/canonical_path_without_namespacing.rs +++ b/bindgen-tests/tests/expectations/tests/canonical_path_without_namespacing.rs @@ -4,6 +4,7 @@ pub struct Bar { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 1usize]; ["Alignment of Bar"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/char.rs b/bindgen-tests/tests/expectations/tests/char.rs index 531c70213b..61a81269d7 100644 --- a/bindgen-tests/tests/expectations/tests/char.rs +++ b/bindgen-tests/tests/expectations/tests/char.rs @@ -18,6 +18,7 @@ pub struct Test { pub Ccu: UChar, pub Ccd: SChar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test"][::std::mem::size_of::() - 12usize]; ["Alignment of Test"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/class_nested.rs b/bindgen-tests/tests/expectations/tests/class_nested.rs index e3d4c2e65e..881a95fd93 100644 --- a/bindgen-tests/tests/expectations/tests/class_nested.rs +++ b/bindgen-tests/tests/expectations/tests/class_nested.rs @@ -9,6 +9,7 @@ pub struct A { pub struct A_B { pub member_b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A_B"][::std::mem::size_of::() - 4usize]; ["Alignment of A_B"][::std::mem::align_of::() - 4usize]; @@ -29,6 +30,7 @@ impl Default for A_D { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 4usize]; ["Alignment of A"][::std::mem::align_of::() - 4usize]; @@ -39,6 +41,7 @@ const _: () = { pub struct A_C { pub baz: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A_C"][::std::mem::size_of::() - 4usize]; ["Alignment of A_C"][::std::mem::align_of::() - 4usize]; @@ -47,6 +50,7 @@ const _: () = { extern "C" { pub static mut var: A_B; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: A_D_open0_int_close0", @@ -63,6 +67,7 @@ extern "C" { pub struct D { pub member: A_B, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of D"][::std::mem::size_of::() - 4usize]; ["Alignment of D"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/class_no_members.rs b/bindgen-tests/tests/expectations/tests/class_no_members.rs index 13e6410c3d..c50da6a02d 100644 --- a/bindgen-tests/tests/expectations/tests/class_no_members.rs +++ b/bindgen-tests/tests/expectations/tests/class_no_members.rs @@ -4,6 +4,7 @@ pub struct whatever { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of whatever"][::std::mem::size_of::() - 1usize]; ["Alignment of whatever"][::std::mem::align_of::() - 1usize]; @@ -13,6 +14,7 @@ const _: () = { pub struct whatever_child { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of whatever_child"][::std::mem::size_of::() - 1usize]; ["Alignment of whatever_child"][::std::mem::align_of::() - 1usize]; @@ -22,6 +24,7 @@ const _: () = { pub struct whatever_child_with_member { pub m_member: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of whatever_child_with_member", diff --git a/bindgen-tests/tests/expectations/tests/class_static.rs b/bindgen-tests/tests/expectations/tests/class_static.rs index a1ded6bf35..c93968fa0c 100644 --- a/bindgen-tests/tests/expectations/tests/class_static.rs +++ b/bindgen-tests/tests/expectations/tests/class_static.rs @@ -12,6 +12,7 @@ extern "C" { #[link_name = "\u{1}_ZN7MyClass26example_check_no_collisionE"] pub static mut MyClass_example_check_no_collision: *const ::std::os::raw::c_int; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of MyClass"][::std::mem::size_of::() - 1usize]; ["Alignment of MyClass"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/class_static_const.rs b/bindgen-tests/tests/expectations/tests/class_static_const.rs index 68b2a8a45c..d628239c4c 100644 --- a/bindgen-tests/tests/expectations/tests/class_static_const.rs +++ b/bindgen-tests/tests/expectations/tests/class_static_const.rs @@ -7,6 +7,7 @@ pub struct A { pub const A_a: ::std::os::raw::c_int = 0; pub const A_b: i32 = 63; pub const A_c: u32 = 255; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 1usize]; ["Alignment of A"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/class_use_as.rs b/bindgen-tests/tests/expectations/tests/class_use_as.rs index b91c32c723..ec898ff7eb 100644 --- a/bindgen-tests/tests/expectations/tests/class_use_as.rs +++ b/bindgen-tests/tests/expectations/tests/class_use_as.rs @@ -5,6 +5,7 @@ pub struct whatever { pub replacement: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of whatever"][::std::mem::size_of::() - 4usize]; ["Alignment of whatever"][::std::mem::align_of::() - 4usize]; @@ -17,6 +18,7 @@ const _: () = { pub struct container { pub c: whatever, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of container"][::std::mem::size_of::() - 4usize]; ["Alignment of container"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/class_with_dtor.rs b/bindgen-tests/tests/expectations/tests/class_with_dtor.rs index 01d7399e59..aa99f42468 100644 --- a/bindgen-tests/tests/expectations/tests/class_with_dtor.rs +++ b/bindgen-tests/tests/expectations/tests/class_with_dtor.rs @@ -20,6 +20,7 @@ pub type HandleValue = HandleWithDtor<::std::os::raw::c_int>; pub struct WithoutDtor { pub shouldBeWithDtor: HandleValue, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of WithoutDtor"][::std::mem::size_of::() - 8usize]; ["Alignment of WithoutDtor"][::std::mem::align_of::() - 8usize]; @@ -36,6 +37,7 @@ impl Default for WithoutDtor { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: HandleWithDtor_open0_int_close0", diff --git a/bindgen-tests/tests/expectations/tests/class_with_inner_struct.rs b/bindgen-tests/tests/expectations/tests/class_with_inner_struct.rs index e7483370b4..710026c72f 100644 --- a/bindgen-tests/tests/expectations/tests/class_with_inner_struct.rs +++ b/bindgen-tests/tests/expectations/tests/class_with_inner_struct.rs @@ -12,6 +12,7 @@ pub struct A_Segment { pub begin: ::std::os::raw::c_int, pub end: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A_Segment"][::std::mem::size_of::() - 8usize]; ["Alignment of A_Segment"][::std::mem::align_of::() - 4usize]; @@ -25,6 +26,7 @@ const _: () = { pub union A__bindgen_ty_1 { pub f: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; ["Alignment of A__bindgen_ty_1"][::std::mem::align_of::() - 4usize]; @@ -46,6 +48,7 @@ impl Default for A__bindgen_ty_1 { pub union A__bindgen_ty_2 { pub d: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A__bindgen_ty_2"][::std::mem::size_of::() - 4usize]; ["Alignment of A__bindgen_ty_2"][::std::mem::align_of::() - 4usize]; @@ -62,6 +65,7 @@ impl Default for A__bindgen_ty_2 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 12usize]; ["Alignment of A"][::std::mem::align_of::() - 4usize]; @@ -88,6 +92,7 @@ pub struct B_Segment { pub begin: ::std::os::raw::c_int, pub end: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of B_Segment"][::std::mem::size_of::() - 8usize]; ["Alignment of B_Segment"][::std::mem::align_of::() - 4usize]; @@ -96,6 +101,7 @@ const _: () = { ][::std::mem::offset_of!(B_Segment, begin) - 0usize]; ["Offset of field: B_Segment::end"][::std::mem::offset_of!(B_Segment, end) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of B"][::std::mem::size_of::() - 4usize]; ["Alignment of B"][::std::mem::align_of::() - 4usize]; @@ -129,6 +135,7 @@ pub struct C__bindgen_ty_1__bindgen_ty_1 { pub mX2: f32, pub mY2: f32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of C__bindgen_ty_1__bindgen_ty_1", @@ -155,6 +162,7 @@ pub struct C__bindgen_ty_1__bindgen_ty_2 { pub mStepSyntax: StepSyntax, pub mSteps: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of C__bindgen_ty_1__bindgen_ty_2", @@ -178,6 +186,7 @@ impl Default for C__bindgen_ty_1__bindgen_ty_2 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C__bindgen_ty_1"][::std::mem::size_of::() - 16usize]; ["Alignment of C__bindgen_ty_1"][::std::mem::align_of::() - 4usize]; @@ -200,6 +209,7 @@ pub struct C_Segment { pub begin: ::std::os::raw::c_int, pub end: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C_Segment"][::std::mem::size_of::() - 8usize]; ["Alignment of C_Segment"][::std::mem::align_of::() - 4usize]; @@ -208,6 +218,7 @@ const _: () = { ][::std::mem::offset_of!(C_Segment, begin) - 0usize]; ["Offset of field: C_Segment::end"][::std::mem::offset_of!(C_Segment, end) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 20usize]; ["Alignment of C"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/class_with_typedef.rs b/bindgen-tests/tests/expectations/tests/class_with_typedef.rs index 2d078541bf..9a89732036 100644 --- a/bindgen-tests/tests/expectations/tests/class_with_typedef.rs +++ b/bindgen-tests/tests/expectations/tests/class_with_typedef.rs @@ -11,6 +11,7 @@ pub struct C { } pub type C_MyInt = ::std::os::raw::c_int; pub type C_Lookup = *const ::std::os::raw::c_char; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 72usize]; ["Alignment of C"][::std::mem::align_of::() - 8usize]; @@ -69,6 +70,7 @@ pub struct D { pub _base: C, pub ptr: *mut C_MyInt, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of D"][::std::mem::size_of::() - 80usize]; ["Alignment of D"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/comment-indent.rs b/bindgen-tests/tests/expectations/tests/comment-indent.rs index 47e6ebb185..72b167d00c 100644 --- a/bindgen-tests/tests/expectations/tests/comment-indent.rs +++ b/bindgen-tests/tests/expectations/tests/comment-indent.rs @@ -19,10 +19,12 @@ pub mod root { pub struct Foo_Bar { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo_Bar"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo_Bar"][::std::mem::align_of::() - 1usize]; }; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; @@ -44,6 +46,7 @@ pub mod root { +------+ +-------+*/ pub member: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Baz"][::std::mem::size_of::() - 4usize]; ["Alignment of Baz"][::std::mem::align_of::() - 4usize]; @@ -59,6 +62,7 @@ pub mod root { pub struct InInlineNS { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of InInlineNS"][::std::mem::size_of::() - 1usize]; ["Alignment of InInlineNS"][::std::mem::align_of::() - 1usize]; @@ -68,6 +72,7 @@ pub mod root { pub struct Bazz { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bazz"][::std::mem::size_of::() - 1usize]; ["Alignment of Bazz"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/complex.rs b/bindgen-tests/tests/expectations/tests/complex.rs index b3e165ae0e..233b86ea36 100644 --- a/bindgen-tests/tests/expectations/tests/complex.rs +++ b/bindgen-tests/tests/expectations/tests/complex.rs @@ -10,6 +10,7 @@ pub struct __BindgenComplex { pub struct TestDouble { pub mMember: __BindgenComplex, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of TestDouble"][::std::mem::size_of::() - 16usize]; ["Alignment of TestDouble"][::std::mem::align_of::() - 8usize]; @@ -22,6 +23,7 @@ const _: () = { pub struct TestDoublePtr { pub mMember: *mut __BindgenComplex, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of TestDoublePtr"][::std::mem::size_of::() - 8usize]; ["Alignment of TestDoublePtr"][::std::mem::align_of::() - 8usize]; @@ -43,6 +45,7 @@ impl Default for TestDoublePtr { pub struct TestFloat { pub mMember: __BindgenComplex, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of TestFloat"][::std::mem::size_of::() - 8usize]; ["Alignment of TestFloat"][::std::mem::align_of::() - 4usize]; @@ -55,6 +58,7 @@ const _: () = { pub struct TestFloatPtr { pub mMember: *mut __BindgenComplex, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of TestFloatPtr"][::std::mem::size_of::() - 8usize]; ["Alignment of TestFloatPtr"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/const-const-mut-ptr.rs b/bindgen-tests/tests/expectations/tests/const-const-mut-ptr.rs index e3bf776898..72a34da105 100644 --- a/bindgen-tests/tests/expectations/tests/const-const-mut-ptr.rs +++ b/bindgen-tests/tests/expectations/tests/const-const-mut-ptr.rs @@ -4,6 +4,7 @@ pub struct foo { pub bar: *const *const *mut *const ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 8usize]; ["Alignment of foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/const_array_typedef.rs b/bindgen-tests/tests/expectations/tests/const_array_typedef.rs index 115c934813..a9ddc0c85e 100644 --- a/bindgen-tests/tests/expectations/tests/const_array_typedef.rs +++ b/bindgen-tests/tests/expectations/tests/const_array_typedef.rs @@ -4,6 +4,7 @@ pub struct strct { pub field: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of strct"][::std::mem::size_of::() - 4usize]; ["Alignment of strct"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/const_bool.rs b/bindgen-tests/tests/expectations/tests/const_bool.rs index 1625454a9f..2cbab47390 100644 --- a/bindgen-tests/tests/expectations/tests/const_bool.rs +++ b/bindgen-tests/tests/expectations/tests/const_bool.rs @@ -6,6 +6,7 @@ pub struct A { pub _address: u8, } pub const A_k: bool = false; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 1usize]; ["Alignment of A"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/const_enum_unnamed.rs b/bindgen-tests/tests/expectations/tests/const_enum_unnamed.rs index e3484479db..f49d825224 100644 --- a/bindgen-tests/tests/expectations/tests/const_enum_unnamed.rs +++ b/bindgen-tests/tests/expectations/tests/const_enum_unnamed.rs @@ -18,6 +18,7 @@ pub const Foo_FOO_BAR: Foo__bindgen_ty_1 = Foo__bindgen_ty_1::FOO_BAR; pub enum Foo__bindgen_ty_1 { FOO_BAR = 10, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/constified-enum-module-overflow.rs b/bindgen-tests/tests/expectations/tests/constified-enum-module-overflow.rs index c72ecf57dd..e5eada9abc 100644 --- a/bindgen-tests/tests/expectations/tests/constified-enum-module-overflow.rs +++ b/bindgen-tests/tests/expectations/tests/constified-enum-module-overflow.rs @@ -15,11 +15,13 @@ pub type C_U = B; pub struct A { pub u: B, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 1usize]; ["Alignment of A"][::std::mem::align_of::() - 1usize]; ["Offset of field: A::u"][::std::mem::offset_of!(A, u) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: C_open0_A_close0", @@ -28,6 +30,7 @@ const _: () = { "Align of template specialization: C_open0_A_close0", ][::std::mem::align_of::() - 1usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_A_close0", diff --git a/bindgen-tests/tests/expectations/tests/constify-all-enums.rs b/bindgen-tests/tests/expectations/tests/constify-all-enums.rs index 0447a147ff..7913454b56 100644 --- a/bindgen-tests/tests/expectations/tests/constify-all-enums.rs +++ b/bindgen-tests/tests/expectations/tests/constify-all-enums.rs @@ -8,6 +8,7 @@ pub type foo = ::std::os::raw::c_uint; pub struct bar { pub this_should_work: foo, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar"][::std::mem::size_of::() - 4usize]; ["Alignment of bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/constify-module-enums-basic.rs b/bindgen-tests/tests/expectations/tests/constify-module-enums-basic.rs index 6bbcda650d..ec0e51c49e 100644 --- a/bindgen-tests/tests/expectations/tests/constify-module-enums-basic.rs +++ b/bindgen-tests/tests/expectations/tests/constify-module-enums-basic.rs @@ -12,6 +12,7 @@ pub use self::foo_alias1 as foo_alias2; pub struct bar { pub this_should_work: foo::Type, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar"][::std::mem::size_of::() - 4usize]; ["Alignment of bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/constify-module-enums-namespace.rs b/bindgen-tests/tests/expectations/tests/constify-module-enums-namespace.rs index 1f96f8aacc..883478a824 100644 --- a/bindgen-tests/tests/expectations/tests/constify-module-enums-namespace.rs +++ b/bindgen-tests/tests/expectations/tests/constify-module-enums-namespace.rs @@ -24,6 +24,7 @@ pub mod root { pub struct bar { pub this_should_work: root::ns1::ns2::foo::Type, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar"][::std::mem::size_of::() - 4usize]; ["Alignment of bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/constify-module-enums-shadow-name.rs b/bindgen-tests/tests/expectations/tests/constify-module-enums-shadow-name.rs index d65bcd81b7..b5e4243c94 100644 --- a/bindgen-tests/tests/expectations/tests/constify-module-enums-shadow-name.rs +++ b/bindgen-tests/tests/expectations/tests/constify-module-enums-shadow-name.rs @@ -11,6 +11,7 @@ pub mod foo { pub struct bar { pub member: foo::Type, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar"][::std::mem::size_of::() - 4usize]; ["Alignment of bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/constify-module-enums-simple-alias.rs b/bindgen-tests/tests/expectations/tests/constify-module-enums-simple-alias.rs index 0aa58bb9a1..63d48ef795 100644 --- a/bindgen-tests/tests/expectations/tests/constify-module-enums-simple-alias.rs +++ b/bindgen-tests/tests/expectations/tests/constify-module-enums-simple-alias.rs @@ -20,6 +20,7 @@ pub struct Bar { pub baz_ptr3: *mut Foo_alias2, pub baz_ptr4: *mut Foo_alias3, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 48usize]; ["Alignment of Bar"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs b/bindgen-tests/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs index b12bfab49e..80fa0734da 100644 --- a/bindgen-tests/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs +++ b/bindgen-tests/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs @@ -10,6 +10,7 @@ pub struct Bar { pub baz1: one_Foo::Type, pub baz2: *mut one_Foo::Type, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 16usize]; ["Alignment of Bar"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/constify-module-enums-types.rs b/bindgen-tests/tests/expectations/tests/constify-module-enums-types.rs index 24b6b21fa5..754f6ceedb 100644 --- a/bindgen-tests/tests/expectations/tests/constify-module-enums-types.rs +++ b/bindgen-tests/tests/expectations/tests/constify-module-enums-types.rs @@ -45,6 +45,7 @@ pub struct bar { pub member9: anon_enum_alias2, pub member10: anon_enum_alias3, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar"][::std::mem::size_of::() - 48usize]; ["Alignment of bar"][::std::mem::align_of::() - 8usize]; @@ -73,6 +74,7 @@ impl Default for bar { pub struct Baz { pub member1: ns2_Foo::Type, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Baz"][::std::mem::size_of::() - 4usize]; ["Alignment of Baz"][::std::mem::align_of::() - 4usize]; @@ -97,6 +99,7 @@ pub mod one_Foo { pub struct Bar { pub baz: *mut one_Foo::Type, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 8usize]; ["Alignment of Bar"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/constructor-tp.rs b/bindgen-tests/tests/expectations/tests/constructor-tp.rs index 30cbd86c18..1a6e9c40dc 100644 --- a/bindgen-tests/tests/expectations/tests/constructor-tp.rs +++ b/bindgen-tests/tests/expectations/tests/constructor-tp.rs @@ -9,6 +9,7 @@ pub struct Foo { pub struct Bar { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 1usize]; ["Alignment of Bar"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/constructors.rs b/bindgen-tests/tests/expectations/tests/constructors.rs index aa54ae4c4a..9da761e40a 100644 --- a/bindgen-tests/tests/expectations/tests/constructors.rs +++ b/bindgen-tests/tests/expectations/tests/constructors.rs @@ -4,6 +4,7 @@ pub struct TestOverload { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of TestOverload"][::std::mem::size_of::() - 1usize]; ["Alignment of TestOverload"][::std::mem::align_of::() - 1usize]; @@ -38,6 +39,7 @@ impl TestOverload { pub struct TestPublicNoArgs { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of TestPublicNoArgs"][::std::mem::size_of::() - 1usize]; [ diff --git a/bindgen-tests/tests/expectations/tests/contains-vs-inherits-zero-sized.rs b/bindgen-tests/tests/expectations/tests/contains-vs-inherits-zero-sized.rs index 8cec58751c..3362280843 100644 --- a/bindgen-tests/tests/expectations/tests/contains-vs-inherits-zero-sized.rs +++ b/bindgen-tests/tests/expectations/tests/contains-vs-inherits-zero-sized.rs @@ -5,6 +5,7 @@ pub struct Empty { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Empty"][::std::mem::size_of::() - 1usize]; ["Alignment of Empty"][::std::mem::align_of::() - 1usize]; @@ -16,6 +17,7 @@ const _: () = { pub struct Inherits { pub b: bool, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Inherits"][::std::mem::size_of::() - 1usize]; ["Alignment of Inherits"][::std::mem::align_of::() - 1usize]; @@ -29,6 +31,7 @@ pub struct Contains { pub empty: Empty, pub b: bool, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Contains"][::std::mem::size_of::() - 2usize]; ["Alignment of Contains"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/convert-floats.rs b/bindgen-tests/tests/expectations/tests/convert-floats.rs index bef0f6e5b7..9ca939f7c5 100644 --- a/bindgen-tests/tests/expectations/tests/convert-floats.rs +++ b/bindgen-tests/tests/expectations/tests/convert-floats.rs @@ -15,6 +15,7 @@ pub struct foo { pub complexFloat: __BindgenComplex<::std::os::raw::c_float>, pub complexDouble: __BindgenComplex<::std::os::raw::c_double>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 48usize]; ["Alignment of foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/cpp-empty-layout.rs b/bindgen-tests/tests/expectations/tests/cpp-empty-layout.rs index 30de3dce72..551dff82cf 100644 --- a/bindgen-tests/tests/expectations/tests/cpp-empty-layout.rs +++ b/bindgen-tests/tests/expectations/tests/cpp-empty-layout.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/crtp.rs b/bindgen-tests/tests/expectations/tests/crtp.rs index 0685411bf8..68397041b7 100644 --- a/bindgen-tests/tests/expectations/tests/crtp.rs +++ b/bindgen-tests/tests/expectations/tests/crtp.rs @@ -9,6 +9,7 @@ pub struct Base { pub struct Derived { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Derived"][::std::mem::size_of::() - 1usize]; ["Alignment of Derived"][::std::mem::align_of::() - 1usize]; @@ -23,6 +24,7 @@ pub struct BaseWithDestructor { pub struct DerivedFromBaseWithDestructor { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of DerivedFromBaseWithDestructor", @@ -31,6 +33,7 @@ const _: () = { "Alignment of DerivedFromBaseWithDestructor", ][::std::mem::align_of::() - 1usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Base_open0_Derived_close0", @@ -39,6 +42,7 @@ const _: () = { "Align of template specialization: Base_open0_Derived_close0", ][::std::mem::align_of::() - 1usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: BaseWithDestructor_open0_DerivedFromBaseWithDestructor_close0", diff --git a/bindgen-tests/tests/expectations/tests/ctypes-prefix-path.rs b/bindgen-tests/tests/expectations/tests/ctypes-prefix-path.rs index 14b4917f0b..5f947f9cea 100644 --- a/bindgen-tests/tests/expectations/tests/ctypes-prefix-path.rs +++ b/bindgen-tests/tests/expectations/tests/ctypes-prefix-path.rs @@ -13,6 +13,7 @@ pub struct foo { pub b: libc::foo::c_int, pub bar: *mut libc::foo::c_void, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::core::mem::size_of::() - 16usize]; ["Alignment of foo"][::core::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/default-template-parameter.rs b/bindgen-tests/tests/expectations/tests/default-template-parameter.rs index a1fdcf9016..797fc03253 100644 --- a/bindgen-tests/tests/expectations/tests/default-template-parameter.rs +++ b/bindgen-tests/tests/expectations/tests/default-template-parameter.rs @@ -16,6 +16,7 @@ impl Default for Foo { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Foo_open0_bool__int_close0", diff --git a/bindgen-tests/tests/expectations/tests/deleted-function.rs b/bindgen-tests/tests/expectations/tests/deleted-function.rs index 3abcf618cf..913e2d4b4a 100644 --- a/bindgen-tests/tests/expectations/tests/deleted-function.rs +++ b/bindgen-tests/tests/expectations/tests/deleted-function.rs @@ -4,6 +4,7 @@ pub struct A { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 1usize]; ["Alignment of A"][::std::mem::align_of::() - 1usize]; @@ -31,6 +32,7 @@ impl A { pub struct B { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of B"][::std::mem::size_of::() - 1usize]; ["Alignment of B"][::std::mem::align_of::() - 1usize]; @@ -40,6 +42,7 @@ const _: () = { pub struct C { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 1usize]; ["Alignment of C"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/derive-custom-cli.rs b/bindgen-tests/tests/expectations/tests/derive-custom-cli.rs index 48dbede146..59a3a76571 100644 --- a/bindgen-tests/tests/expectations/tests/derive-custom-cli.rs +++ b/bindgen-tests/tests/expectations/tests/derive-custom-cli.rs @@ -4,6 +4,7 @@ pub struct foo_struct { pub inner: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo_struct"][::std::mem::size_of::() - 4usize]; ["Alignment of foo_struct"][::std::mem::align_of::() - 4usize]; @@ -22,6 +23,7 @@ pub union foo_union { pub fst: ::std::mem::ManuallyDrop<::std::os::raw::c_int>, pub snd: ::std::mem::ManuallyDrop, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo_union"][::std::mem::size_of::() - 4usize]; ["Alignment of foo_union"][::std::mem::align_of::() - 4usize]; @@ -32,6 +34,7 @@ const _: () = { pub struct non_matching { pub inner: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of non_matching"][::std::mem::size_of::() - 4usize]; ["Alignment of non_matching"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/derive-debug-mangle-name.rs b/bindgen-tests/tests/expectations/tests/derive-debug-mangle-name.rs index c61fb0149a..34b4a87d65 100644 --- a/bindgen-tests/tests/expectations/tests/derive-debug-mangle-name.rs +++ b/bindgen-tests/tests/expectations/tests/derive-debug-mangle-name.rs @@ -12,6 +12,7 @@ pub union perf_event_attr__bindgen_ty_1 { pub b: ::std::os::raw::c_int, pub c: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of perf_event_attr__bindgen_ty_1", @@ -40,6 +41,7 @@ impl ::std::fmt::Debug for perf_event_attr__bindgen_ty_1 { write!(f, "perf_event_attr__bindgen_ty_1 {{ union }}") } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of perf_event_attr"][::std::mem::size_of::() - 12usize]; ["Alignment of perf_event_attr"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/derive-default-and-blocklist.rs b/bindgen-tests/tests/expectations/tests/derive-default-and-blocklist.rs index 75404fcc0b..6ce99e5093 100644 --- a/bindgen-tests/tests/expectations/tests/derive-default-and-blocklist.rs +++ b/bindgen-tests/tests/expectations/tests/derive-default-and-blocklist.rs @@ -6,6 +6,7 @@ pub struct BlocklistMe(u8); pub struct ShouldNotDeriveDefault { pub a: BlocklistMe, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ShouldNotDeriveDefault", diff --git a/bindgen-tests/tests/expectations/tests/derive-fn-ptr.rs b/bindgen-tests/tests/expectations/tests/derive-fn-ptr.rs index 3e0b984bbc..f4b09474ae 100644 --- a/bindgen-tests/tests/expectations/tests/derive-fn-ptr.rs +++ b/bindgen-tests/tests/expectations/tests/derive-fn-ptr.rs @@ -24,6 +24,7 @@ pub type my_fun_t = ::std::option::Option< pub struct Foo { pub callback: my_fun_t, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 8usize]; ["Alignment of Foo"][::std::mem::align_of::() - 8usize]; @@ -50,6 +51,7 @@ pub type my_fun2_t = ::std::option::Option< pub struct Bar { pub callback: my_fun2_t, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 8usize]; ["Alignment of Bar"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/derive-hash-and-blocklist.rs b/bindgen-tests/tests/expectations/tests/derive-hash-and-blocklist.rs index 092244d5ba..c52047e8b8 100644 --- a/bindgen-tests/tests/expectations/tests/derive-hash-and-blocklist.rs +++ b/bindgen-tests/tests/expectations/tests/derive-hash-and-blocklist.rs @@ -5,6 +5,7 @@ pub struct BlocklistMe(u8); pub struct ShouldNotDeriveHash { pub a: BlocklistMe, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ShouldNotDeriveHash", diff --git a/bindgen-tests/tests/expectations/tests/derive-hash-blocklisting.rs b/bindgen-tests/tests/expectations/tests/derive-hash-blocklisting.rs index d8b65e8e09..e3223f08d7 100644 --- a/bindgen-tests/tests/expectations/tests/derive-hash-blocklisting.rs +++ b/bindgen-tests/tests/expectations/tests/derive-hash-blocklisting.rs @@ -11,6 +11,7 @@ pub struct Blocklisted { pub struct AllowlistedOne { pub a: Blocklisted<::std::os::raw::c_int>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AllowlistedOne"][::std::mem::size_of::() - 4usize]; ["Alignment of AllowlistedOne"][::std::mem::align_of::() - 4usize]; @@ -32,6 +33,7 @@ impl Default for AllowlistedOne { pub struct AllowlistedTwo { pub b: Blocklisted, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AllowlistedTwo"][::std::mem::size_of::() - 4usize]; ["Alignment of AllowlistedTwo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs b/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs index ea434ae83b..2d66015fe7 100644 --- a/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs +++ b/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs @@ -11,6 +11,7 @@ pub struct foo__bindgen_ty_1 { pub a: f32, pub b: f32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; [ @@ -23,6 +24,7 @@ const _: () = { "Offset of field: foo__bindgen_ty_1::b", ][::std::mem::offset_of!(foo__bindgen_ty_1, b) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 8usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-float-array.rs b/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-float-array.rs index b22ce29e48..254a50b3e3 100644 --- a/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-float-array.rs +++ b/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-float-array.rs @@ -5,6 +5,7 @@ pub struct foo { pub bar: [f32; 3usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 12usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs b/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs index 657f72ece4..2588a49eed 100644 --- a/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs +++ b/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs @@ -35,6 +35,7 @@ pub struct test { pub a: ::std::os::raw::c_int, pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of test"][::std::mem::size_of::() - 4usize]; ["Alignment of test"][::std::mem::align_of::() - 4usize]; @@ -49,6 +50,7 @@ pub struct test2 { pub a: ::std::os::raw::c_int, pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of test2"][::std::mem::size_of::() - 4usize]; ["Alignment of test2"][::std::mem::align_of::() - 4usize]; @@ -64,6 +66,7 @@ pub struct test3 { pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>, pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of test3"][::std::mem::size_of::() - 4usize]; ["Alignment of test3"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-pointer.rs b/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-pointer.rs index b27091fa69..5240d969db 100644 --- a/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-pointer.rs +++ b/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-pointer.rs @@ -5,6 +5,7 @@ pub struct ConstPtrMutObj { pub bar: *mut ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ConstPtrMutObj"][::std::mem::size_of::() - 8usize]; ["Alignment of ConstPtrMutObj"][::std::mem::align_of::() - 8usize]; @@ -26,6 +27,7 @@ impl Default for ConstPtrMutObj { pub struct MutPtrMutObj { pub bar: *mut ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of MutPtrMutObj"][::std::mem::size_of::() - 8usize]; ["Alignment of MutPtrMutObj"][::std::mem::align_of::() - 8usize]; @@ -47,6 +49,7 @@ impl Default for MutPtrMutObj { pub struct MutPtrConstObj { pub bar: *const ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of MutPtrConstObj"][::std::mem::size_of::() - 8usize]; ["Alignment of MutPtrConstObj"][::std::mem::align_of::() - 8usize]; @@ -68,6 +71,7 @@ impl Default for MutPtrConstObj { pub struct ConstPtrConstObj { pub bar: *const ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ConstPtrConstObj"][::std::mem::size_of::() - 8usize]; [ diff --git a/bindgen-tests/tests/expectations/tests/derive-hash-template-inst-float.rs b/bindgen-tests/tests/expectations/tests/derive-hash-template-inst-float.rs index 03a8b22cbb..10ed002e6e 100644 --- a/bindgen-tests/tests/expectations/tests/derive-hash-template-inst-float.rs +++ b/bindgen-tests/tests/expectations/tests/derive-hash-template-inst-float.rs @@ -21,6 +21,7 @@ impl Default for foo { pub struct IntStr { pub a: foo<::std::os::raw::c_int>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of IntStr"][::std::mem::size_of::() - 4usize]; ["Alignment of IntStr"][::std::mem::align_of::() - 4usize]; @@ -41,6 +42,7 @@ impl Default for IntStr { pub struct FloatStr { pub a: foo, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of FloatStr"][::std::mem::size_of::() - 4usize]; ["Alignment of FloatStr"][::std::mem::align_of::() - 4usize]; @@ -55,6 +57,7 @@ impl Default for FloatStr { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: foo_open0_int_close0", @@ -63,6 +66,7 @@ const _: () = { "Align of template specialization: foo_open0_int_close0", ][::std::mem::align_of::>() - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: foo_open0_float_close0", diff --git a/bindgen-tests/tests/expectations/tests/derive-partialeq-and-blocklist.rs b/bindgen-tests/tests/expectations/tests/derive-partialeq-and-blocklist.rs index 558fc86a44..d24981061c 100644 --- a/bindgen-tests/tests/expectations/tests/derive-partialeq-and-blocklist.rs +++ b/bindgen-tests/tests/expectations/tests/derive-partialeq-and-blocklist.rs @@ -6,6 +6,7 @@ pub struct BlocklistMe(u8); pub struct ShouldNotDerivePartialEq { pub a: BlocklistMe, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ShouldNotDerivePartialEq", diff --git a/bindgen-tests/tests/expectations/tests/derive-partialeq-anonfield.rs b/bindgen-tests/tests/expectations/tests/derive-partialeq-anonfield.rs index 02fa0e7303..c4eb08df60 100644 --- a/bindgen-tests/tests/expectations/tests/derive-partialeq-anonfield.rs +++ b/bindgen-tests/tests/expectations/tests/derive-partialeq-anonfield.rs @@ -11,6 +11,7 @@ pub struct rte_mbuf { pub struct rte_mbuf__bindgen_ty_1 { pub bindgen_union_field: [u8; 0usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_1", @@ -28,6 +29,7 @@ impl Default for rte_mbuf__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_mbuf"][::std::mem::size_of::() - 0usize]; ["Alignment of rte_mbuf"][::std::mem::align_of::() - 64usize]; diff --git a/bindgen-tests/tests/expectations/tests/derive-partialeq-pointer.rs b/bindgen-tests/tests/expectations/tests/derive-partialeq-pointer.rs index fde2269b3b..3e48e5d8ce 100644 --- a/bindgen-tests/tests/expectations/tests/derive-partialeq-pointer.rs +++ b/bindgen-tests/tests/expectations/tests/derive-partialeq-pointer.rs @@ -4,6 +4,7 @@ pub struct Bar { pub b: *mut a, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 8usize]; ["Alignment of Bar"][::std::mem::align_of::() - 8usize]; @@ -28,6 +29,7 @@ pub struct c { pub union c__bindgen_ty_1 { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of c__bindgen_ty_1"][::std::mem::size_of::() - 1usize]; ["Alignment of c__bindgen_ty_1"][::std::mem::align_of::() - 1usize]; @@ -41,6 +43,7 @@ impl Default for c__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of c"][::std::mem::size_of::() - 1usize]; ["Alignment of c"][::std::mem::align_of::() - 1usize]; @@ -59,6 +62,7 @@ impl Default for c { pub struct a { pub d: c, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of a"][::std::mem::size_of::() - 1usize]; ["Alignment of a"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/derive-partialeq-union.rs b/bindgen-tests/tests/expectations/tests/derive-partialeq-union.rs index 9dd183d073..0365c765eb 100644 --- a/bindgen-tests/tests/expectations/tests/derive-partialeq-union.rs +++ b/bindgen-tests/tests/expectations/tests/derive-partialeq-union.rs @@ -6,6 +6,7 @@ pub union ShouldNotDerivePartialEq { pub a: ::std::os::raw::c_char, pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ShouldNotDerivePartialEq", diff --git a/bindgen-tests/tests/expectations/tests/disable-nested-struct-naming.rs b/bindgen-tests/tests/expectations/tests/disable-nested-struct-naming.rs index cd020d2763..68c729b735 100644 --- a/bindgen-tests/tests/expectations/tests/disable-nested-struct-naming.rs +++ b/bindgen-tests/tests/expectations/tests/disable-nested-struct-naming.rs @@ -27,11 +27,13 @@ pub struct bar1__bindgen_ty_1__bindgen_ty_1 { pub struct bar4 { pub x4: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar4"][::std::mem::size_of::() - 4usize]; ["Alignment of bar4"][::std::mem::align_of::() - 4usize]; ["Offset of field: bar4::x4"][::std::mem::offset_of!(bar4, x4) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of bar1__bindgen_ty_1__bindgen_ty_1", @@ -46,6 +48,7 @@ const _: () = { "Offset of field: bar1__bindgen_ty_1__bindgen_ty_1::b4", ][::std::mem::offset_of!(bar1__bindgen_ty_1__bindgen_ty_1, b4) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of bar1__bindgen_ty_1", @@ -60,12 +63,14 @@ const _: () = { "Offset of field: bar1__bindgen_ty_1::b3", ][::std::mem::offset_of!(bar1__bindgen_ty_1, b3) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar1"][::std::mem::size_of::() - 16usize]; ["Alignment of bar1"][::std::mem::align_of::() - 4usize]; ["Offset of field: bar1::x1"][::std::mem::offset_of!(bar1, x1) - 0usize]; ["Offset of field: bar1::b2"][::std::mem::offset_of!(bar1, b2) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 16usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; @@ -86,11 +91,13 @@ pub struct _bindgen_ty_1__bindgen_ty_1 { pub struct baz { pub x: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of baz"][::std::mem::size_of::() - 4usize]; ["Alignment of baz"][::std::mem::align_of::() - 4usize]; ["Offset of field: baz::x"][::std::mem::offset_of!(baz, x) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of _bindgen_ty_1__bindgen_ty_1", @@ -102,6 +109,7 @@ const _: () = { "Offset of field: _bindgen_ty_1__bindgen_ty_1::b", ][::std::mem::offset_of!(_bindgen_ty_1__bindgen_ty_1, b) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _bindgen_ty_1"][::std::mem::size_of::<_bindgen_ty_1>() - 4usize]; ["Alignment of _bindgen_ty_1"][::std::mem::align_of::<_bindgen_ty_1>() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/disable-untagged-union.rs b/bindgen-tests/tests/expectations/tests/disable-untagged-union.rs index 3e45778f08..60636280e4 100644 --- a/bindgen-tests/tests/expectations/tests/disable-untagged-union.rs +++ b/bindgen-tests/tests/expectations/tests/disable-untagged-union.rs @@ -49,6 +49,7 @@ pub struct Foo { pub baz: __BindgenUnionField<::std::os::raw::c_uint>, pub bindgen_union_field: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 4usize]; ["Alignment of Foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/do-not-derive-copy.rs b/bindgen-tests/tests/expectations/tests/do-not-derive-copy.rs index 894bc93971..29ca6d6acf 100644 --- a/bindgen-tests/tests/expectations/tests/do-not-derive-copy.rs +++ b/bindgen-tests/tests/expectations/tests/do-not-derive-copy.rs @@ -4,6 +4,7 @@ pub struct WouldBeCopyButWeAreNotDerivingCopy { pub x: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of WouldBeCopyButWeAreNotDerivingCopy", diff --git a/bindgen-tests/tests/expectations/tests/doggo-or-null.rs b/bindgen-tests/tests/expectations/tests/doggo-or-null.rs index d9169b7ecd..972da871d3 100644 --- a/bindgen-tests/tests/expectations/tests/doggo-or-null.rs +++ b/bindgen-tests/tests/expectations/tests/doggo-or-null.rs @@ -4,6 +4,7 @@ pub struct Doggo { pub x: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Doggo"][::std::mem::size_of::() - 4usize]; ["Alignment of Doggo"][::std::mem::align_of::() - 4usize]; @@ -14,6 +15,7 @@ const _: () = { pub struct Null { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Null"][::std::mem::size_of::() - 1usize]; ["Alignment of Null"][::std::mem::align_of::() - 1usize]; @@ -30,6 +32,7 @@ const _: () = { pub union DoggoOrNull { pub _bindgen_opaque_blob: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of DoggoOrNull"][::std::mem::size_of::() - 4usize]; ["Alignment of DoggoOrNull"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/duplicated-definition-count.rs b/bindgen-tests/tests/expectations/tests/duplicated-definition-count.rs index f757029c2b..85f28dcca6 100644 --- a/bindgen-tests/tests/expectations/tests/duplicated-definition-count.rs +++ b/bindgen-tests/tests/expectations/tests/duplicated-definition-count.rs @@ -4,6 +4,7 @@ pub struct BitStream { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of BitStream"][::std::mem::size_of::() - 1usize]; ["Alignment of BitStream"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/duplicated-namespaces-definitions.rs b/bindgen-tests/tests/expectations/tests/duplicated-namespaces-definitions.rs index de1b5ae94d..775a21ac30 100644 --- a/bindgen-tests/tests/expectations/tests/duplicated-namespaces-definitions.rs +++ b/bindgen-tests/tests/expectations/tests/duplicated-namespaces-definitions.rs @@ -12,6 +12,7 @@ pub mod root { pub foo: ::std::os::raw::c_int, pub baz: bool, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 8usize]; ["Alignment of Bar"][::std::mem::align_of::() - 4usize]; @@ -27,6 +28,7 @@ pub mod root { pub struct Foo { pub ptr: *mut root::foo::Bar, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 8usize]; ["Alignment of Foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/dynamic_loading_with_blocklist.rs b/bindgen-tests/tests/expectations/tests/dynamic_loading_with_blocklist.rs index 4908159826..776da1ca5f 100644 --- a/bindgen-tests/tests/expectations/tests/dynamic_loading_with_blocklist.rs +++ b/bindgen-tests/tests/expectations/tests/dynamic_loading_with_blocklist.rs @@ -4,6 +4,7 @@ pub struct X { pub _x: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of X"][::std::mem::size_of::() - 4usize]; ["Alignment of X"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/dynamic_loading_with_class.rs b/bindgen-tests/tests/expectations/tests/dynamic_loading_with_class.rs index 694d7e4ad5..93c636ebff 100644 --- a/bindgen-tests/tests/expectations/tests/dynamic_loading_with_class.rs +++ b/bindgen-tests/tests/expectations/tests/dynamic_loading_with_class.rs @@ -4,6 +4,7 @@ pub struct A { pub _x: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 4usize]; ["Alignment of A"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/enum-default-bitfield.rs b/bindgen-tests/tests/expectations/tests/enum-default-bitfield.rs index 56d30ae3a0..58b8bf092f 100644 --- a/bindgen-tests/tests/expectations/tests/enum-default-bitfield.rs +++ b/bindgen-tests/tests/expectations/tests/enum-default-bitfield.rs @@ -35,6 +35,7 @@ impl ::std::ops::BitAndAssign for foo__bindgen_ty_1 { #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct foo__bindgen_ty_1(pub ::std::os::raw::c_uint); +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/enum-default-consts.rs b/bindgen-tests/tests/expectations/tests/enum-default-consts.rs index 9c409690cf..af51864c2c 100644 --- a/bindgen-tests/tests/expectations/tests/enum-default-consts.rs +++ b/bindgen-tests/tests/expectations/tests/enum-default-consts.rs @@ -7,6 +7,7 @@ pub struct foo { pub const foo_FOO_A: foo__bindgen_ty_1 = 0; pub const foo_FOO_B: foo__bindgen_ty_1 = 1; pub type foo__bindgen_ty_1 = ::std::os::raw::c_uint; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/enum-default-module.rs b/bindgen-tests/tests/expectations/tests/enum-default-module.rs index 9e5d408d66..cc09d49425 100644 --- a/bindgen-tests/tests/expectations/tests/enum-default-module.rs +++ b/bindgen-tests/tests/expectations/tests/enum-default-module.rs @@ -9,6 +9,7 @@ pub mod foo__bindgen_ty_1 { pub const FOO_A: Type = 0; pub const FOO_B: Type = 1; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/enum-default-rust.rs b/bindgen-tests/tests/expectations/tests/enum-default-rust.rs index d2ca40eeb7..f9a99166de 100644 --- a/bindgen-tests/tests/expectations/tests/enum-default-rust.rs +++ b/bindgen-tests/tests/expectations/tests/enum-default-rust.rs @@ -12,6 +12,7 @@ pub enum foo__bindgen_ty_1 { FOO_A = 0, FOO_B = 1, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/enum-no-debug-rust.rs b/bindgen-tests/tests/expectations/tests/enum-no-debug-rust.rs index 26bd668292..b728dfc898 100644 --- a/bindgen-tests/tests/expectations/tests/enum-no-debug-rust.rs +++ b/bindgen-tests/tests/expectations/tests/enum-no-debug-rust.rs @@ -12,6 +12,7 @@ pub enum foo__bindgen_ty_1 { FOO_A = 0, FOO_B = 1, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/enum.rs b/bindgen-tests/tests/expectations/tests/enum.rs index f542ad0bef..820182125a 100644 --- a/bindgen-tests/tests/expectations/tests/enum.rs +++ b/bindgen-tests/tests/expectations/tests/enum.rs @@ -7,6 +7,7 @@ pub struct foo { pub const foo_FOO_A: foo__bindgen_ty_1 = 0; pub const foo_FOO_B: foo__bindgen_ty_1 = 1; pub type foo__bindgen_ty_1 = ::std::os::raw::c_uint; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/enum_and_vtable_mangling.rs b/bindgen-tests/tests/expectations/tests/enum_and_vtable_mangling.rs index 4ee86d9251..18e1ad8e36 100644 --- a/bindgen-tests/tests/expectations/tests/enum_and_vtable_mangling.rs +++ b/bindgen-tests/tests/expectations/tests/enum_and_vtable_mangling.rs @@ -17,6 +17,7 @@ pub struct C { pub vtable_: *const C__bindgen_vtable, pub i: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 16usize]; ["Alignment of C"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/explicit-padding.rs b/bindgen-tests/tests/expectations/tests/explicit-padding.rs index 847c8ed492..ec21399106 100644 --- a/bindgen-tests/tests/expectations/tests/explicit-padding.rs +++ b/bindgen-tests/tests/expectations/tests/explicit-padding.rs @@ -8,6 +8,7 @@ pub struct pad_me { pub third: u16, pub __bindgen_padding_1: [u8; 2usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of pad_me"][::std::mem::size_of::() - 12usize]; ["Alignment of pad_me"][::std::mem::align_of::() - 4usize]; @@ -22,6 +23,7 @@ pub union dont_pad_me { pub second: u32, pub third: u16, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of dont_pad_me"][::std::mem::size_of::() - 4usize]; ["Alignment of dont_pad_me"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/field-visibility-callback.rs b/bindgen-tests/tests/expectations/tests/field-visibility-callback.rs index 2599c3ef9f..9be373e5a7 100644 --- a/bindgen-tests/tests/expectations/tests/field-visibility-callback.rs +++ b/bindgen-tests/tests/expectations/tests/field-visibility-callback.rs @@ -92,6 +92,7 @@ pub struct my_struct { _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, __bindgen_padding_0: [u8; 3usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of my_struct"][::std::mem::size_of::() - 12usize]; ["Alignment of my_struct"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/field-visibility.rs b/bindgen-tests/tests/expectations/tests/field-visibility.rs index af74644c93..2ad5dc838e 100644 --- a/bindgen-tests/tests/expectations/tests/field-visibility.rs +++ b/bindgen-tests/tests/expectations/tests/field-visibility.rs @@ -91,6 +91,7 @@ pub struct my_struct1 { _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, __bindgen_padding_0: [u8; 3usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of my_struct1"][::std::mem::size_of::() - 4usize]; ["Alignment of my_struct1"][::std::mem::align_of::() - 4usize]; @@ -130,6 +131,7 @@ pub struct my_struct2 { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub __bindgen_padding_0: [u8; 3usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of my_struct2"][::std::mem::size_of::() - 4usize]; ["Alignment of my_struct2"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/flexarray.rs b/bindgen-tests/tests/expectations/tests/flexarray.rs index ece5e62419..b9c800366e 100644 --- a/bindgen-tests/tests/expectations/tests/flexarray.rs +++ b/bindgen-tests/tests/expectations/tests/flexarray.rs @@ -37,6 +37,7 @@ pub struct flexarray { pub count: ::std::os::raw::c_int, pub data: FAM, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of flexarray"][::std::mem::size_of::() - 4usize]; ["Alignment of flexarray"][::std::mem::align_of::() - 4usize]; @@ -126,6 +127,7 @@ pub struct flexarray_zero { pub count: ::std::os::raw::c_int, pub data: FAM, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of flexarray_zero"][::std::mem::size_of::() - 4usize]; ["Alignment of flexarray_zero"][::std::mem::align_of::() - 4usize]; @@ -310,6 +312,7 @@ impl Default for flexarray_template { pub struct flexarray_ref { pub things: *mut flexarray, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of flexarray_ref"][::std::mem::size_of::() - 8usize]; ["Alignment of flexarray_ref"][::std::mem::align_of::() - 8usize]; @@ -333,6 +336,7 @@ pub struct flexarray_bogus_zero_fam { pub data1: __IncompleteArrayField<::std::os::raw::c_int>, pub data2: FAM, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of flexarray_bogus_zero_fam", @@ -447,6 +451,7 @@ pub struct flexarray_align { pub count: ::std::os::raw::c_int, pub data: FAM, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of flexarray_align"][::std::mem::size_of::() - 128usize]; [ diff --git a/bindgen-tests/tests/expectations/tests/float16.rs b/bindgen-tests/tests/expectations/tests/float16.rs index f218df495d..1804d1007a 100644 --- a/bindgen-tests/tests/expectations/tests/float16.rs +++ b/bindgen-tests/tests/expectations/tests/float16.rs @@ -10,6 +10,7 @@ extern "C" { pub struct Test__Float16 { pub f: __BindgenFloat16, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test__Float16"][::std::mem::size_of::() - 2usize]; ["Alignment of Test__Float16"][::std::mem::align_of::() - 2usize]; @@ -22,6 +23,7 @@ const _: () = { pub struct Test__Float16Ref { pub f: *mut __BindgenFloat16, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test__Float16Ref"][::std::mem::size_of::() - 8usize]; [ diff --git a/bindgen-tests/tests/expectations/tests/forward-declaration-autoptr.rs b/bindgen-tests/tests/expectations/tests/forward-declaration-autoptr.rs index 162c4b6004..b74b408841 100644 --- a/bindgen-tests/tests/expectations/tests/forward-declaration-autoptr.rs +++ b/bindgen-tests/tests/expectations/tests/forward-declaration-autoptr.rs @@ -24,6 +24,7 @@ impl Default for RefPtr { pub struct Bar { pub m_member: RefPtr, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 8usize]; ["Alignment of Bar"][::std::mem::align_of::() - 8usize]; @@ -38,6 +39,7 @@ impl Default for Bar { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: RefPtr_open0_Foo_close0", diff --git a/bindgen-tests/tests/expectations/tests/forward_declared_complex_types.rs b/bindgen-tests/tests/expectations/tests/forward_declared_complex_types.rs index 17dd065a85..2ba1071c8e 100644 --- a/bindgen-tests/tests/expectations/tests/forward_declared_complex_types.rs +++ b/bindgen-tests/tests/expectations/tests/forward_declared_complex_types.rs @@ -4,6 +4,7 @@ pub struct Foo_empty { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo_empty"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo_empty"][::std::mem::align_of::() - 1usize]; @@ -18,6 +19,7 @@ pub struct Foo { pub struct Bar { pub f: *mut Foo, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 8usize]; ["Alignment of Bar"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/forward_declared_struct.rs b/bindgen-tests/tests/expectations/tests/forward_declared_struct.rs index 20ae5c2e4f..1f6dfd0f58 100644 --- a/bindgen-tests/tests/expectations/tests/forward_declared_struct.rs +++ b/bindgen-tests/tests/expectations/tests/forward_declared_struct.rs @@ -4,6 +4,7 @@ pub struct a { pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of a"][::std::mem::size_of::() - 4usize]; ["Alignment of a"][::std::mem::align_of::() - 4usize]; @@ -14,6 +15,7 @@ const _: () = { pub struct c { pub d: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of c"][::std::mem::size_of::() - 4usize]; ["Alignment of c"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/func_ptr_in_struct.rs b/bindgen-tests/tests/expectations/tests/func_ptr_in_struct.rs index c09ba012a3..308bb069e0 100644 --- a/bindgen-tests/tests/expectations/tests/func_ptr_in_struct.rs +++ b/bindgen-tests/tests/expectations/tests/func_ptr_in_struct.rs @@ -11,6 +11,7 @@ pub struct Foo { unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> baz, >, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 8usize]; ["Alignment of Foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/func_return_must_use.rs b/bindgen-tests/tests/expectations/tests/func_return_must_use.rs index 08c3e28443..bc9deb0818 100644 --- a/bindgen-tests/tests/expectations/tests/func_return_must_use.rs +++ b/bindgen-tests/tests/expectations/tests/func_return_must_use.rs @@ -28,6 +28,7 @@ extern "C" { #[derive(Debug, Default, Copy, Clone)] #[must_use] pub struct AnnotatedStruct {} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AnnotatedStruct"][::std::mem::size_of::() - 0usize]; ["Alignment of AnnotatedStruct"][::std::mem::align_of::() - 1usize]; @@ -39,6 +40,7 @@ extern "C" { #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct PlainStruct {} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PlainStruct"][::std::mem::size_of::() - 0usize]; ["Alignment of PlainStruct"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/gen-constructors-neg.rs b/bindgen-tests/tests/expectations/tests/gen-constructors-neg.rs index 30de3dce72..551dff82cf 100644 --- a/bindgen-tests/tests/expectations/tests/gen-constructors-neg.rs +++ b/bindgen-tests/tests/expectations/tests/gen-constructors-neg.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/gen-constructors.rs b/bindgen-tests/tests/expectations/tests/gen-constructors.rs index 870e645493..c1a8b676fd 100644 --- a/bindgen-tests/tests/expectations/tests/gen-constructors.rs +++ b/bindgen-tests/tests/expectations/tests/gen-constructors.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/gen-destructors-neg.rs b/bindgen-tests/tests/expectations/tests/gen-destructors-neg.rs index 95eeb8a508..77b6a07bb1 100644 --- a/bindgen-tests/tests/expectations/tests/gen-destructors-neg.rs +++ b/bindgen-tests/tests/expectations/tests/gen-destructors-neg.rs @@ -4,6 +4,7 @@ pub struct Foo { pub bar: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 4usize]; ["Alignment of Foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/gen-destructors.rs b/bindgen-tests/tests/expectations/tests/gen-destructors.rs index 35af32923b..f3dc655f08 100644 --- a/bindgen-tests/tests/expectations/tests/gen-destructors.rs +++ b/bindgen-tests/tests/expectations/tests/gen-destructors.rs @@ -4,6 +4,7 @@ pub struct Foo { pub bar: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 4usize]; ["Alignment of Foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/generate-inline.rs b/bindgen-tests/tests/expectations/tests/generate-inline.rs index e63ae1862c..1d60a98570 100644 --- a/bindgen-tests/tests/expectations/tests/generate-inline.rs +++ b/bindgen-tests/tests/expectations/tests/generate-inline.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/incomplete-array-padding.rs b/bindgen-tests/tests/expectations/tests/incomplete-array-padding.rs index 214667a23a..148f4ffa41 100644 --- a/bindgen-tests/tests/expectations/tests/incomplete-array-padding.rs +++ b/bindgen-tests/tests/expectations/tests/incomplete-array-padding.rs @@ -120,6 +120,7 @@ pub struct foo { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub b: __IncompleteArrayField<*mut ::std::os::raw::c_void>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 8usize]; ["Alignment of foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/inherit-from-template-instantiation-with-vtable.rs b/bindgen-tests/tests/expectations/tests/inherit-from-template-instantiation-with-vtable.rs index 11b1df8703..59e35f7b6c 100644 --- a/bindgen-tests/tests/expectations/tests/inherit-from-template-instantiation-with-vtable.rs +++ b/bindgen-tests/tests/expectations/tests/inherit-from-template-instantiation-with-vtable.rs @@ -24,6 +24,7 @@ impl Default for BaseWithVtable { pub struct DerivedWithNoVirtualMethods { pub _base: BaseWithVtable<*mut ::std::os::raw::c_char>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of DerivedWithNoVirtualMethods", @@ -47,6 +48,7 @@ impl Default for DerivedWithNoVirtualMethods { pub struct DerivedWithVirtualMethods { pub _base: BaseWithVtable<*mut ::std::os::raw::c_char>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of DerivedWithVirtualMethods", @@ -89,6 +91,7 @@ pub struct DerivedWithVtable { pub vtable_: *const DerivedWithVtable__bindgen_vtable, pub _base: BaseWithoutVtable<*mut ::std::os::raw::c_char>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of DerivedWithVtable"][::std::mem::size_of::() - 16usize]; [ @@ -110,6 +113,7 @@ impl Default for DerivedWithVtable { pub struct DerivedWithoutVtable { pub _base: BaseWithoutVtable<*mut ::std::os::raw::c_char>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of DerivedWithoutVtable", @@ -127,6 +131,7 @@ impl Default for DerivedWithoutVtable { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: BaseWithVtable_open0_ptr_char_close0", @@ -135,6 +140,7 @@ const _: () = { "Align of template specialization: BaseWithVtable_open0_ptr_char_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: BaseWithVtable_open0_ptr_char_close0", @@ -143,6 +149,7 @@ const _: () = { "Align of template specialization: BaseWithVtable_open0_ptr_char_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: BaseWithoutVtable_open0_ptr_char_close0", @@ -151,6 +158,7 @@ const _: () = { "Align of template specialization: BaseWithoutVtable_open0_ptr_char_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: BaseWithoutVtable_open0_ptr_char_close0", diff --git a/bindgen-tests/tests/expectations/tests/inherit_multiple_interfaces.rs b/bindgen-tests/tests/expectations/tests/inherit_multiple_interfaces.rs index a4b0d2a867..da9e519156 100644 --- a/bindgen-tests/tests/expectations/tests/inherit_multiple_interfaces.rs +++ b/bindgen-tests/tests/expectations/tests/inherit_multiple_interfaces.rs @@ -7,6 +7,7 @@ pub struct A { pub vtable_: *const A__bindgen_vtable, pub member: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 16usize]; ["Alignment of A"][::std::mem::align_of::() - 8usize]; @@ -29,6 +30,7 @@ pub struct B { pub vtable_: *const B__bindgen_vtable, pub member2: *mut ::std::os::raw::c_void, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of B"][::std::mem::size_of::() - 16usize]; ["Alignment of B"][::std::mem::align_of::() - 8usize]; @@ -50,6 +52,7 @@ pub struct C { pub _base_1: B, pub member3: f32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 40usize]; ["Alignment of C"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/inherit_typedef.rs b/bindgen-tests/tests/expectations/tests/inherit_typedef.rs index e82fc06ce9..92320f45ef 100644 --- a/bindgen-tests/tests/expectations/tests/inherit_typedef.rs +++ b/bindgen-tests/tests/expectations/tests/inherit_typedef.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; @@ -14,6 +15,7 @@ pub type TypedefedFoo = Foo; pub struct Bar { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 1usize]; ["Alignment of Bar"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/inline_namespace.rs b/bindgen-tests/tests/expectations/tests/inline_namespace.rs index 72839492c1..df05ab7b9d 100644 --- a/bindgen-tests/tests/expectations/tests/inline_namespace.rs +++ b/bindgen-tests/tests/expectations/tests/inline_namespace.rs @@ -13,6 +13,7 @@ pub mod root { pub struct Bar { pub baz: root::foo::Ty, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 4usize]; ["Alignment of Bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/inline_namespace_conservative.rs b/bindgen-tests/tests/expectations/tests/inline_namespace_conservative.rs index 6ac6cb7d6c..6941e74adb 100644 --- a/bindgen-tests/tests/expectations/tests/inline_namespace_conservative.rs +++ b/bindgen-tests/tests/expectations/tests/inline_namespace_conservative.rs @@ -18,6 +18,7 @@ pub mod root { pub struct Bar { pub baz: root::foo::bar::Ty, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 4usize]; ["Alignment of Bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/inner_const.rs b/bindgen-tests/tests/expectations/tests/inner_const.rs index 157ccce994..f8f0c45a29 100644 --- a/bindgen-tests/tests/expectations/tests/inner_const.rs +++ b/bindgen-tests/tests/expectations/tests/inner_const.rs @@ -12,6 +12,7 @@ extern "C" { #[link_name = "\u{1}_ZN3Foo8whateverE"] pub static mut Foo_whatever: Foo; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 4usize]; ["Alignment of Foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/inner_template_self.rs b/bindgen-tests/tests/expectations/tests/inner_template_self.rs index 1c42ebea43..c8f9799be6 100644 --- a/bindgen-tests/tests/expectations/tests/inner_template_self.rs +++ b/bindgen-tests/tests/expectations/tests/inner_template_self.rs @@ -19,6 +19,7 @@ impl Default for LinkedList { pub struct InstantiateIt { pub m_list: LinkedList, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of InstantiateIt"][::std::mem::size_of::() - 16usize]; ["Alignment of InstantiateIt"][::std::mem::align_of::() - 8usize]; @@ -35,6 +36,7 @@ impl Default for InstantiateIt { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: LinkedList_open0_int_close0", diff --git a/bindgen-tests/tests/expectations/tests/issue-1034.rs b/bindgen-tests/tests/expectations/tests/issue-1034.rs index fff0e13ef9..17450a1346 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1034.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1034.rs @@ -89,6 +89,7 @@ pub struct S2 { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of S2"][::std::mem::size_of::() - 2usize]; ["Alignment of S2"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1076-unnamed-bitfield-alignment.rs b/bindgen-tests/tests/expectations/tests/issue-1076-unnamed-bitfield-alignment.rs index 8f9c0489ed..5bdf08d992 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1076-unnamed-bitfield-alignment.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1076-unnamed-bitfield-alignment.rs @@ -89,6 +89,7 @@ pub struct S1 { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of S1"][::std::mem::size_of::() - 3usize]; ["Alignment of S1"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1118-using-forward-decl.rs b/bindgen-tests/tests/expectations/tests/issue-1118-using-forward-decl.rs index 13350e2b5c..7356aa679a 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1118-using-forward-decl.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1118-using-forward-decl.rs @@ -5,6 +5,7 @@ pub type c = nsTArray; pub struct nsTArray_base { pub d: *mut ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of nsTArray_base"][::std::mem::size_of::() - 8usize]; ["Alignment of nsTArray_base"][::std::mem::align_of::() - 8usize]; @@ -40,6 +41,7 @@ impl Default for nsTArray { pub struct nsIContent { pub foo: nsTArray, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of nsIContent"][::std::mem::size_of::() - 8usize]; ["Alignment of nsIContent"][::std::mem::align_of::() - 8usize]; @@ -60,6 +62,7 @@ extern "C" { #[link_name = "\u{1}_Z35Gecko_GetAnonymousContentForElementv"] pub fn Gecko_GetAnonymousContentForElement() -> *mut nsTArray; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: nsTArray_open0_ptr_nsIContent_close0", @@ -68,6 +71,7 @@ const _: () = { "Align of template specialization: nsTArray_open0_ptr_nsIContent_close0", ][::std::mem::align_of::() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: nsTArray_open0_ptr_nsIContent_close0", diff --git a/bindgen-tests/tests/expectations/tests/issue-1197-pure-virtual-stuff.rs b/bindgen-tests/tests/expectations/tests/issue-1197-pure-virtual-stuff.rs index eef11c24c3..10c769c38c 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1197-pure-virtual-stuff.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1197-pure-virtual-stuff.rs @@ -6,6 +6,7 @@ pub struct Foo__bindgen_vtable(::std::os::raw::c_void); pub struct Foo { pub vtable_: *const Foo__bindgen_vtable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 8usize]; ["Alignment of Foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1216-variadic-member.rs b/bindgen-tests/tests/expectations/tests/issue-1216-variadic-member.rs index 25fba1d1f1..e3fe803654 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1216-variadic-member.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1216-variadic-member.rs @@ -14,6 +14,7 @@ pub struct Foo { ), >, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 8usize]; ["Alignment of Foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1281.rs b/bindgen-tests/tests/expectations/tests/issue-1281.rs index e5f82313e6..03c80d21fb 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1281.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1281.rs @@ -9,11 +9,13 @@ pub struct bar { pub struct foo { pub foo: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; ["Offset of field: foo::foo"][::std::mem::offset_of!(foo, foo) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar"][::std::mem::size_of::() - 4usize]; ["Alignment of bar"][::std::mem::align_of::() - 4usize]; @@ -25,6 +27,7 @@ pub type bar_t = bar; pub struct baz { pub f: foo, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of baz"][::std::mem::size_of::() - 4usize]; ["Alignment of baz"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1285.rs b/bindgen-tests/tests/expectations/tests/issue-1285.rs index 5cd95f777f..6520163259 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1285.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1285.rs @@ -10,6 +10,7 @@ pub union foo__bindgen_ty_1 { pub a: ::std::os::raw::c_uint, pub b: ::std::os::raw::c_ushort, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; [ @@ -31,6 +32,7 @@ impl Default for foo__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1382-rust-primitive-types.rs b/bindgen-tests/tests/expectations/tests/issue-1382-rust-primitive-types.rs index 094a6d2c94..277978d93c 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1382-rust-primitive-types.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1382-rust-primitive-types.rs @@ -25,6 +25,7 @@ pub struct Foo { pub f32_: ::std::os::raw::c_int, pub f64_: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 56usize]; ["Alignment of Foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1443.rs b/bindgen-tests/tests/expectations/tests/issue-1443.rs index 9412d58f5d..ee1ffca8e5 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1443.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1443.rs @@ -10,6 +10,7 @@ pub struct Bar { pub f: *const Foo, pub m: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 16usize]; ["Alignment of Bar"][::std::mem::align_of::() - 8usize]; @@ -31,6 +32,7 @@ pub struct Baz { pub f: *mut Foo, pub m: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Baz"][::std::mem::size_of::() - 16usize]; ["Alignment of Baz"][::std::mem::align_of::() - 8usize]; @@ -52,6 +54,7 @@ pub struct Tar { pub f: *const Foo, pub m: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Tar"][::std::mem::size_of::() - 16usize]; ["Alignment of Tar"][::std::mem::align_of::() - 8usize]; @@ -73,6 +76,7 @@ pub struct Taz { pub f: *mut Foo, pub m: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Taz"][::std::mem::size_of::() - 16usize]; ["Alignment of Taz"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1454.rs b/bindgen-tests/tests/expectations/tests/issue-1454.rs index caa0339662..325ccfd977 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1454.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1454.rs @@ -7,6 +7,7 @@ pub struct extern_type; pub struct local_type { pub inner: extern_type, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of local_type"][::std::mem::size_of::() - 0usize]; ["Alignment of local_type"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1498.rs b/bindgen-tests/tests/expectations/tests/issue-1498.rs index 993777da46..286d2eb6ee 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1498.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1498.rs @@ -24,6 +24,7 @@ pub union rte_memseg__bindgen_ty_1 { ///< Makes sure addr is always 64 bits pub addr_64: u64, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_memseg__bindgen_ty_1", @@ -47,6 +48,7 @@ impl Default for rte_memseg__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_memseg"][::std::mem::size_of::() - 44usize]; ["Alignment of rte_memseg"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1947.rs b/bindgen-tests/tests/expectations/tests/issue-1947.rs index 46925bc19e..32f9bbe146 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1947.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1947.rs @@ -96,6 +96,7 @@ pub struct V56AMDY { pub _bitfield_2: __BindgenBitfieldUnit<[u8; 3usize]>, pub _rB_: U8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of V56AMDY"][::std::mem::size_of::() - 8usize]; ["Alignment of V56AMDY"][::std::mem::align_of::() - 2usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1977-larger-arrays.rs b/bindgen-tests/tests/expectations/tests/issue-1977-larger-arrays.rs index 077d2a5ccb..df7a2192ed 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1977-larger-arrays.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1977-larger-arrays.rs @@ -4,6 +4,7 @@ pub struct S { pub large_array: [::std::os::raw::c_char; 33usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of S"][::std::mem::size_of::() - 33usize]; ["Alignment of S"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-1995.rs b/bindgen-tests/tests/expectations/tests/issue-1995.rs index a598f71b86..0e36bdd9c9 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1995.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1995.rs @@ -11,6 +11,7 @@ pub const FOO: ::std::os::raw::c_int = 1; pub struct Bar { pub baz: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 4usize]; ["Alignment of Bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-2019.rs b/bindgen-tests/tests/expectations/tests/issue-2019.rs index 72fe8bf1b9..88921d615a 100644 --- a/bindgen-tests/tests/expectations/tests/issue-2019.rs +++ b/bindgen-tests/tests/expectations/tests/issue-2019.rs @@ -4,6 +4,7 @@ pub struct A { pub a: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 4usize]; ["Alignment of A"][::std::mem::align_of::() - 4usize]; @@ -24,6 +25,7 @@ impl A { pub struct B { pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of B"][::std::mem::size_of::() - 4usize]; ["Alignment of B"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-2556.rs b/bindgen-tests/tests/expectations/tests/issue-2556.rs index b78fa4237d..5f7c1d369a 100644 --- a/bindgen-tests/tests/expectations/tests/issue-2556.rs +++ b/bindgen-tests/tests/expectations/tests/issue-2556.rs @@ -9,6 +9,7 @@ pub mod root { pub width: ::std::os::raw::c_int, pub height: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of nsSize"][::std::mem::size_of::() - 8usize]; ["Alignment of nsSize"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-2695.rs b/bindgen-tests/tests/expectations/tests/issue-2695.rs index daf218356a..20a016dbab 100644 --- a/bindgen-tests/tests/expectations/tests/issue-2695.rs +++ b/bindgen-tests/tests/expectations/tests/issue-2695.rs @@ -8,6 +8,7 @@ pub struct Test { pub c: ::std::os::raw::c_char, pub __bindgen_padding_0: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test"][::std::mem::size_of::() - 12usize]; ["Alignment of Test"][::std::mem::align_of::() - 2usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-410.rs b/bindgen-tests/tests/expectations/tests/issue-410.rs index 28a2893035..e52aa25a13 100644 --- a/bindgen-tests/tests/expectations/tests/issue-410.rs +++ b/bindgen-tests/tests/expectations/tests/issue-410.rs @@ -11,6 +11,7 @@ pub mod root { pub struct Value { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Value"][::std::mem::size_of::() - 1usize]; ["Alignment of Value"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-447.rs b/bindgen-tests/tests/expectations/tests/issue-447.rs index 0231b40aa8..305fa739d0 100644 --- a/bindgen-tests/tests/expectations/tests/issue-447.rs +++ b/bindgen-tests/tests/expectations/tests/issue-447.rs @@ -14,6 +14,7 @@ pub mod root { pub struct GuardObjectNotifier { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of GuardObjectNotifier", @@ -29,6 +30,7 @@ pub mod root { pub struct JSAutoCompartment { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of JSAutoCompartment", diff --git a/bindgen-tests/tests/expectations/tests/issue-537.rs b/bindgen-tests/tests/expectations/tests/issue-537.rs index 6a7bc3edfd..d630b9ea4c 100644 --- a/bindgen-tests/tests/expectations/tests/issue-537.rs +++ b/bindgen-tests/tests/expectations/tests/issue-537.rs @@ -6,6 +6,7 @@ pub struct AlignedToOne { pub i: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AlignedToOne"][::std::mem::size_of::() - 4usize]; ["Alignment of AlignedToOne"][::std::mem::align_of::() - 1usize]; @@ -20,6 +21,7 @@ const _: () = { pub struct AlignedToTwo { pub i: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AlignedToTwo"][::std::mem::size_of::() - 4usize]; ["Alignment of AlignedToTwo"][::std::mem::align_of::() - 2usize]; @@ -36,6 +38,7 @@ pub struct PackedToOne { pub x: ::std::os::raw::c_int, pub y: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PackedToOne"][::std::mem::size_of::() - 8usize]; ["Alignment of PackedToOne"][::std::mem::align_of::() - 1usize]; @@ -51,6 +54,7 @@ pub struct PackedToTwo { pub x: ::std::os::raw::c_int, pub y: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PackedToTwo"][::std::mem::size_of::() - 8usize]; ["Alignment of PackedToTwo"][::std::mem::align_of::() - 2usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs b/bindgen-tests/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs index ffbbe792ca..567325b82d 100644 --- a/bindgen-tests/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs +++ b/bindgen-tests/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs @@ -27,6 +27,7 @@ impl Default for JS_Base { pub struct JS_AutoIdVector { pub _base: JS_Base, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of JS_AutoIdVector"][::std::mem::size_of::() - 1usize]; ["Alignment of JS_AutoIdVector"][::std::mem::align_of::() - 1usize]; @@ -40,6 +41,7 @@ impl Default for JS_AutoIdVector { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: JS_Base_open0_int_close0", diff --git a/bindgen-tests/tests/expectations/tests/issue-573-layout-test-failures.rs b/bindgen-tests/tests/expectations/tests/issue-573-layout-test-failures.rs index 2c5936e761..aa5f457792 100644 --- a/bindgen-tests/tests/expectations/tests/issue-573-layout-test-failures.rs +++ b/bindgen-tests/tests/expectations/tests/issue-573-layout-test-failures.rs @@ -9,6 +9,7 @@ pub struct Outer { pub struct AutoIdVector { pub ar: Outer, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AutoIdVector"][::std::mem::size_of::() - 1usize]; ["Alignment of AutoIdVector"][::std::mem::align_of::() - 1usize]; @@ -16,6 +17,7 @@ const _: () = { "Offset of field: AutoIdVector::ar", ][::std::mem::offset_of!(AutoIdVector, ar) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Outer_open0_int_close0", diff --git a/bindgen-tests/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs b/bindgen-tests/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs index bcc8ecdb75..85f66c5a73 100644 --- a/bindgen-tests/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs +++ b/bindgen-tests/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs @@ -9,6 +9,7 @@ pub struct a { pub struct _bindgen_ty_1 { pub ar: a, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _bindgen_ty_1"][::std::mem::size_of::<_bindgen_ty_1>() - 1usize]; ["Alignment of _bindgen_ty_1"][::std::mem::align_of::<_bindgen_ty_1>() - 1usize]; @@ -19,6 +20,7 @@ const _: () = { extern "C" { pub static mut AutoIdVector: _bindgen_ty_1; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: a_open0_int_close0", diff --git a/bindgen-tests/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs b/bindgen-tests/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs index cfa6a195e2..e53b10d4af 100644 --- a/bindgen-tests/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs +++ b/bindgen-tests/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs @@ -6,6 +6,7 @@ pub struct A { pub _address: u8, } pub type A_a = b; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 1usize]; ["Alignment of A"][::std::mem::align_of::() - 1usize]; @@ -33,6 +34,7 @@ pub struct f { pub struct g { pub h: f, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of g"][::std::mem::size_of::() - 1usize]; ["Alignment of g"][::std::mem::align_of::() - 1usize]; @@ -51,6 +53,7 @@ impl Default for g { pub struct b { pub _base: g, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of b"][::std::mem::size_of::() - 1usize]; ["Alignment of b"][::std::mem::align_of::() - 1usize]; @@ -68,6 +71,7 @@ extern "C" { #[link_name = "\u{1}_Z25Servo_Element_GetSnapshotv"] pub fn Servo_Element_GetSnapshot() -> A; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: f_open0_e_open1_int_close1_close0", diff --git a/bindgen-tests/tests/expectations/tests/issue-639-typedef-anon-field.rs b/bindgen-tests/tests/expectations/tests/issue-639-typedef-anon-field.rs index 3909ce4e2f..e940db1103 100644 --- a/bindgen-tests/tests/expectations/tests/issue-639-typedef-anon-field.rs +++ b/bindgen-tests/tests/expectations/tests/issue-639-typedef-anon-field.rs @@ -9,11 +9,13 @@ pub struct Foo { pub struct Foo_Bar { pub abc: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo_Bar"][::std::mem::size_of::() - 4usize]; ["Alignment of Foo_Bar"][::std::mem::align_of::() - 4usize]; ["Offset of field: Foo_Bar::abc"][::std::mem::offset_of!(Foo_Bar, abc) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 4usize]; ["Alignment of Foo"][::std::mem::align_of::() - 4usize]; @@ -29,11 +31,13 @@ pub struct Baz { pub struct Baz_Bar { pub abc: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Baz_Bar"][::std::mem::size_of::() - 4usize]; ["Alignment of Baz_Bar"][::std::mem::align_of::() - 4usize]; ["Offset of field: Baz_Bar::abc"][::std::mem::offset_of!(Baz_Bar, abc) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Baz"][::std::mem::size_of::() - 1usize]; ["Alignment of Baz"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-643-inner-struct.rs b/bindgen-tests/tests/expectations/tests/issue-643-inner-struct.rs index 3e3f2ada59..0012c8f6aa 100644 --- a/bindgen-tests/tests/expectations/tests/issue-643-inner-struct.rs +++ b/bindgen-tests/tests/expectations/tests/issue-643-inner-struct.rs @@ -42,6 +42,7 @@ pub struct rte_ring { pub struct rte_ring_prod { pub watermark: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_ring_prod"][::std::mem::size_of::() - 4usize]; ["Alignment of rte_ring_prod"][::std::mem::align_of::() - 4usize]; @@ -54,6 +55,7 @@ const _: () = { pub struct rte_ring_cons { pub sc_dequeue: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_ring_cons"][::std::mem::size_of::() - 4usize]; ["Alignment of rte_ring_cons"][::std::mem::align_of::() - 4usize]; @@ -61,6 +63,7 @@ const _: () = { "Offset of field: rte_ring_cons::sc_dequeue", ][::std::mem::offset_of!(rte_ring_cons, sc_dequeue) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_ring"][::std::mem::size_of::() - 16usize]; ["Alignment of rte_ring"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-674-1.rs b/bindgen-tests/tests/expectations/tests/issue-674-1.rs index 0c45f11f52..1a3dce44d0 100644 --- a/bindgen-tests/tests/expectations/tests/issue-674-1.rs +++ b/bindgen-tests/tests/expectations/tests/issue-674-1.rs @@ -18,6 +18,7 @@ pub mod root { pub struct CapturingContentInfo { pub a: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of CapturingContentInfo", diff --git a/bindgen-tests/tests/expectations/tests/issue-674-2.rs b/bindgen-tests/tests/expectations/tests/issue-674-2.rs index 7a42d02584..980928fe97 100644 --- a/bindgen-tests/tests/expectations/tests/issue-674-2.rs +++ b/bindgen-tests/tests/expectations/tests/issue-674-2.rs @@ -18,6 +18,7 @@ pub mod root { pub struct c { pub b: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of c"][::std::mem::size_of::() - 1usize]; ["Alignment of c"][::std::mem::align_of::() - 1usize]; @@ -28,6 +29,7 @@ pub mod root { pub struct B { pub a: root::c, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of B"][::std::mem::size_of::() - 1usize]; ["Alignment of B"][::std::mem::align_of::() - 1usize]; @@ -38,6 +40,7 @@ pub mod root { pub struct StaticRefPtr { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: StaticRefPtr_open0_B_close0", diff --git a/bindgen-tests/tests/expectations/tests/issue-674-3.rs b/bindgen-tests/tests/expectations/tests/issue-674-3.rs index 8b9f2705bc..4e2f26a46f 100644 --- a/bindgen-tests/tests/expectations/tests/issue-674-3.rs +++ b/bindgen-tests/tests/expectations/tests/issue-674-3.rs @@ -14,6 +14,7 @@ pub mod root { pub struct a { pub b: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of a"][::std::mem::size_of::() - 1usize]; ["Alignment of a"][::std::mem::align_of::() - 1usize]; @@ -24,6 +25,7 @@ pub mod root { pub struct nsCSSValue { pub c: root::a, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of nsCSSValue"][::std::mem::size_of::() - 1usize]; ["Alignment of nsCSSValue"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-691-template-parameter-virtual.rs b/bindgen-tests/tests/expectations/tests/issue-691-template-parameter-virtual.rs index 9c3b00d163..1313d61168 100644 --- a/bindgen-tests/tests/expectations/tests/issue-691-template-parameter-virtual.rs +++ b/bindgen-tests/tests/expectations/tests/issue-691-template-parameter-virtual.rs @@ -6,6 +6,7 @@ pub struct VirtualMethods__bindgen_vtable {} pub struct VirtualMethods { pub vtable_: *const VirtualMethods__bindgen_vtable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of VirtualMethods"][::std::mem::size_of::() - 8usize]; ["Alignment of VirtualMethods"][::std::mem::align_of::() - 8usize]; @@ -29,6 +30,7 @@ pub struct Set { pub struct ServoElementSnapshotTable { pub _base: Set, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ServoElementSnapshotTable", @@ -46,6 +48,7 @@ impl Default for ServoElementSnapshotTable { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Set_open0_VirtualMethods_close0", diff --git a/bindgen-tests/tests/expectations/tests/issue-739-pointer-wide-bitfield.rs b/bindgen-tests/tests/expectations/tests/issue-739-pointer-wide-bitfield.rs index be1eeee425..84dc763e6f 100644 --- a/bindgen-tests/tests/expectations/tests/issue-739-pointer-wide-bitfield.rs +++ b/bindgen-tests/tests/expectations/tests/issue-739-pointer-wide-bitfield.rs @@ -90,6 +90,7 @@ pub struct Foo { pub _bitfield_align_1: [u64; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 32usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 32usize]; ["Alignment of Foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-769-bad-instantiation-test.rs b/bindgen-tests/tests/expectations/tests/issue-769-bad-instantiation-test.rs index cdfe5f652a..59a1d9afa3 100644 --- a/bindgen-tests/tests/expectations/tests/issue-769-bad-instantiation-test.rs +++ b/bindgen-tests/tests/expectations/tests/issue-769-bad-instantiation-test.rs @@ -19,6 +19,7 @@ pub mod root { } } pub type AutoValueVector_Alias = ::std::os::raw::c_int; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Rooted_open0_int_close0", @@ -27,6 +28,7 @@ pub mod root { "Align of template specialization: Rooted_open0_int_close0", ][::std::mem::align_of::>() - 4usize]; }; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Rooted_open0_AutoValueVector_Alias_close0", diff --git a/bindgen-tests/tests/expectations/tests/issue-801-opaque-sloppiness.rs b/bindgen-tests/tests/expectations/tests/issue-801-opaque-sloppiness.rs index 3d39c6642b..b08ef2fd1d 100644 --- a/bindgen-tests/tests/expectations/tests/issue-801-opaque-sloppiness.rs +++ b/bindgen-tests/tests/expectations/tests/issue-801-opaque-sloppiness.rs @@ -10,6 +10,7 @@ pub struct A { pub struct B { pub _bindgen_opaque_blob: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of B"][::std::mem::size_of::() - 1usize]; ["Alignment of B"][::std::mem::align_of::() - 1usize]; @@ -23,6 +24,7 @@ extern "C" { pub struct C { pub b: B, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 1usize]; ["Alignment of C"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs b/bindgen-tests/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs index c268b0cbad..c0150a73f0 100644 --- a/bindgen-tests/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs +++ b/bindgen-tests/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs @@ -4,6 +4,7 @@ pub struct Pupper { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Pupper"][::std::mem::size_of::() - 1usize]; ["Alignment of Pupper"][::std::mem::align_of::() - 1usize]; @@ -13,6 +14,7 @@ const _: () = { pub struct Doggo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Doggo"][::std::mem::size_of::() - 1usize]; ["Alignment of Doggo"][::std::mem::align_of::() - 1usize]; @@ -22,6 +24,7 @@ const _: () = { pub struct SuchWow { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of SuchWow"][::std::mem::size_of::() - 1usize]; ["Alignment of SuchWow"][::std::mem::align_of::() - 1usize]; @@ -32,6 +35,7 @@ const _: () = { pub struct Opaque { pub _bindgen_opaque_blob: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Opaque"][::std::mem::size_of::() - 1usize]; ["Alignment of Opaque"][::std::mem::align_of::() - 1usize]; @@ -65,6 +69,7 @@ extern "C" { pub struct Allowlisted { pub some_member: Opaque, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Allowlisted"][::std::mem::size_of::() - 1usize]; ["Alignment of Allowlisted"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-816.rs b/bindgen-tests/tests/expectations/tests/issue-816.rs index 219bd3c89e..1f1112eff5 100644 --- a/bindgen-tests/tests/expectations/tests/issue-816.rs +++ b/bindgen-tests/tests/expectations/tests/issue-816.rs @@ -90,6 +90,7 @@ pub struct capabilities { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of capabilities"][::std::mem::size_of::() - 16usize]; ["Alignment of capabilities"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-826-generating-methods-when-asked-not-to.rs b/bindgen-tests/tests/expectations/tests/issue-826-generating-methods-when-asked-not-to.rs index 30de3dce72..551dff82cf 100644 --- a/bindgen-tests/tests/expectations/tests/issue-826-generating-methods-when-asked-not-to.rs +++ b/bindgen-tests/tests/expectations/tests/issue-826-generating-methods-when-asked-not-to.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-834.rs b/bindgen-tests/tests/expectations/tests/issue-834.rs index b8cbd24714..4119a450e0 100644 --- a/bindgen-tests/tests/expectations/tests/issue-834.rs +++ b/bindgen-tests/tests/expectations/tests/issue-834.rs @@ -4,6 +4,7 @@ pub struct U { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of U"][::std::mem::size_of::() - 1usize]; ["Alignment of U"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-888-enum-var-decl-jump.rs b/bindgen-tests/tests/expectations/tests/issue-888-enum-var-decl-jump.rs index 66a72aa845..0a0d05f9f9 100644 --- a/bindgen-tests/tests/expectations/tests/issue-888-enum-var-decl-jump.rs +++ b/bindgen-tests/tests/expectations/tests/issue-888-enum-var-decl-jump.rs @@ -15,6 +15,7 @@ pub mod root { #[link_name = "\u{1}_ZN6Halide4Type1bE"] pub static mut Type_b: root::a; } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Type"][::std::mem::size_of::() - 1usize]; ["Alignment of Type"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-944-derive-copy-and-blocklisting.rs b/bindgen-tests/tests/expectations/tests/issue-944-derive-copy-and-blocklisting.rs index 778b9514a0..5e8dde04e3 100644 --- a/bindgen-tests/tests/expectations/tests/issue-944-derive-copy-and-blocklisting.rs +++ b/bindgen-tests/tests/expectations/tests/issue-944-derive-copy-and-blocklisting.rs @@ -5,6 +5,7 @@ pub struct BlocklistMe(u8); pub struct ShouldNotBeCopy { pub a: BlocklistMe, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ShouldNotBeCopy"][::std::mem::size_of::() - 1usize]; ["Alignment of ShouldNotBeCopy"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue-946.rs b/bindgen-tests/tests/expectations/tests/issue-946.rs index 042feccbc1..bdd56c0326 100644 --- a/bindgen-tests/tests/expectations/tests/issue-946.rs +++ b/bindgen-tests/tests/expectations/tests/issue-946.rs @@ -2,6 +2,7 @@ #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct foo {} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 0usize]; ["Alignment of foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/issue_311.rs b/bindgen-tests/tests/expectations/tests/issue_311.rs index fd2e6e80fb..2e0114e43e 100644 --- a/bindgen-tests/tests/expectations/tests/issue_311.rs +++ b/bindgen-tests/tests/expectations/tests/issue_311.rs @@ -13,6 +13,7 @@ pub mod root { pub struct jsval_layout__bindgen_ty_1 { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of jsval_layout__bindgen_ty_1", @@ -21,6 +22,7 @@ pub mod root { "Alignment of jsval_layout__bindgen_ty_1", ][::std::mem::align_of::() - 1usize]; }; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of jsval_layout"][::std::mem::size_of::() - 1usize]; ["Alignment of jsval_layout"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/jsval_layout_opaque.rs b/bindgen-tests/tests/expectations/tests/jsval_layout_opaque.rs index 93fcc92b48..e7cb9af39e 100644 --- a/bindgen-tests/tests/expectations/tests/jsval_layout_opaque.rs +++ b/bindgen-tests/tests/expectations/tests/jsval_layout_opaque.rs @@ -186,6 +186,7 @@ pub struct jsval_layout__bindgen_ty_1 { pub _bitfield_align_1: [u64; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of jsval_layout__bindgen_ty_1", @@ -265,6 +266,7 @@ pub union jsval_layout__bindgen_ty_2__bindgen_ty_1 { pub u32_: u32, pub why: JSWhyMagic, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of jsval_layout__bindgen_ty_2__bindgen_ty_1", @@ -291,6 +293,7 @@ impl Default for jsval_layout__bindgen_ty_2__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of jsval_layout__bindgen_ty_2", @@ -311,6 +314,7 @@ impl Default for jsval_layout__bindgen_ty_2 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of jsval_layout"][::std::mem::size_of::() - 8usize]; ["Alignment of jsval_layout"][::std::mem::align_of::() - 8usize]; @@ -350,6 +354,7 @@ impl Default for jsval_layout { pub struct Value { pub data: jsval_layout, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Value"][::std::mem::size_of::() - 8usize]; ["Alignment of Value"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/layout_align.rs b/bindgen-tests/tests/expectations/tests/layout_align.rs index f7f22120ad..c641ff843f 100644 --- a/bindgen-tests/tests/expectations/tests/layout_align.rs +++ b/bindgen-tests/tests/expectations/tests/layout_align.rs @@ -127,6 +127,7 @@ pub struct rte_kni_fifo { ///< The buffer contains mbuf pointers pub buffer: __IncompleteArrayField<*mut ::std::os::raw::c_void>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_kni_fifo"][::std::mem::size_of::() - 16usize]; ["Alignment of rte_kni_fifo"][::std::mem::align_of::() - 8usize]; @@ -165,6 +166,7 @@ pub struct rte_eth_link { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub __bindgen_padding_0: [u8; 3usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_eth_link"][::std::mem::size_of::() - 8usize]; ["Alignment of rte_eth_link"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/layout_arp.rs b/bindgen-tests/tests/expectations/tests/layout_arp.rs index c48fd0e24e..c94dc2ce24 100644 --- a/bindgen-tests/tests/expectations/tests/layout_arp.rs +++ b/bindgen-tests/tests/expectations/tests/layout_arp.rs @@ -22,6 +22,7 @@ pub struct ether_addr { ///< Addr bytes in tx order pub addr_bytes: [u8; 6usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ether_addr"][::std::mem::size_of::() - 6usize]; ["Alignment of ether_addr"][::std::mem::align_of::() - 1usize]; @@ -42,6 +43,7 @@ pub struct arp_ipv4 { ///< target IP address pub arp_tip: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of arp_ipv4"][::std::mem::size_of::() - 20usize]; ["Alignment of arp_ipv4"][::std::mem::align_of::() - 1usize]; @@ -69,6 +71,7 @@ pub struct arp_hdr { pub arp_op: u16, pub arp_data: arp_ipv4, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of arp_hdr"][::std::mem::size_of::() - 28usize]; ["Alignment of arp_hdr"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/layout_cmdline_token.rs b/bindgen-tests/tests/expectations/tests/layout_cmdline_token.rs index e187a4a7f6..fb7b3bf584 100644 --- a/bindgen-tests/tests/expectations/tests/layout_cmdline_token.rs +++ b/bindgen-tests/tests/expectations/tests/layout_cmdline_token.rs @@ -7,6 +7,7 @@ pub struct cmdline_token_hdr { pub ops: *mut cmdline_token_ops, pub offset: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of cmdline_token_hdr"][::std::mem::size_of::() - 16usize]; [ @@ -84,6 +85,7 @@ pub struct cmdline_token_ops { ) -> ::std::os::raw::c_int, >, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of cmdline_token_ops"][::std::mem::size_of::() - 32usize]; [ @@ -119,6 +121,7 @@ pub enum cmdline_numtype { pub struct cmdline_token_num_data { pub type_: cmdline_numtype, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of cmdline_token_num_data", @@ -145,6 +148,7 @@ pub struct cmdline_token_num { pub hdr: cmdline_token_hdr, pub num_data: cmdline_token_num_data, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of cmdline_token_num"][::std::mem::size_of::() - 24usize]; [ diff --git a/bindgen-tests/tests/expectations/tests/layout_mbuf.rs b/bindgen-tests/tests/expectations/tests/layout_mbuf.rs index c512ad33a2..aa2c121c2d 100644 --- a/bindgen-tests/tests/expectations/tests/layout_mbuf.rs +++ b/bindgen-tests/tests/expectations/tests/layout_mbuf.rs @@ -96,6 +96,7 @@ pub struct rte_atomic16_t { ///< An internal counter value. pub cnt: i16, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_atomic16_t"][::std::mem::size_of::() - 2usize]; ["Alignment of rte_atomic16_t"][::std::mem::align_of::() - 2usize]; @@ -164,6 +165,7 @@ pub union rte_mbuf__bindgen_ty_1 { ///< Non-atomically accessed refcnt pub refcnt: u16, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_1", @@ -201,6 +203,7 @@ pub struct rte_mbuf__bindgen_ty_2__bindgen_ty_1 { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_2__bindgen_ty_1", @@ -370,6 +373,7 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { __bindgen_bitfield_unit } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_2", @@ -420,6 +424,7 @@ pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { pub hash: u16, pub id: u16, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1", @@ -442,6 +447,7 @@ const _: () = { rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, id ) - 2usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1", @@ -465,6 +471,7 @@ impl Default for rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_3__bindgen_ty_1", @@ -491,6 +498,7 @@ pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_2 { pub lo: u32, pub hi: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_3__bindgen_ty_2", @@ -505,6 +513,7 @@ const _: () = { "Offset of field: rte_mbuf__bindgen_ty_3__bindgen_ty_2::hi", ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_3__bindgen_ty_2, hi) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_3", @@ -542,6 +551,7 @@ pub union rte_mbuf__bindgen_ty_4 { ///< Allow 8-byte userdata on 32-bit pub udata64: u64, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_4", @@ -579,6 +589,7 @@ pub struct rte_mbuf__bindgen_ty_5__bindgen_ty_1 { pub _bitfield_align_1: [u16; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 7usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_5__bindgen_ty_1", @@ -725,6 +736,7 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { __bindgen_bitfield_unit } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of rte_mbuf__bindgen_ty_5", @@ -745,6 +757,7 @@ impl Default for rte_mbuf__bindgen_ty_5 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rte_mbuf"][::std::mem::size_of::() - 128usize]; ["Alignment of rte_mbuf"][::std::mem::align_of::() - 64usize]; diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/constified-enum-module-overflow.rs b/bindgen-tests/tests/expectations/tests/libclang-9/constified-enum-module-overflow.rs index a4bdacf3a7..4f8296c65c 100644 --- a/bindgen-tests/tests/expectations/tests/libclang-9/constified-enum-module-overflow.rs +++ b/bindgen-tests/tests/expectations/tests/libclang-9/constified-enum-module-overflow.rs @@ -15,11 +15,13 @@ pub type C_U = B; pub struct A { pub u: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 1usize]; ["Alignment of A"][::std::mem::align_of::() - 1usize]; ["Offset of field: A::u"][::std::mem::offset_of!(A, u) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: C_open0_A_close0", diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/ptr32-has-different-size.rs b/bindgen-tests/tests/expectations/tests/libclang-9/ptr32-has-different-size.rs index 1ffc5249bc..f55f88f496 100644 --- a/bindgen-tests/tests/expectations/tests/libclang-9/ptr32-has-different-size.rs +++ b/bindgen-tests/tests/expectations/tests/libclang-9/ptr32-has-different-size.rs @@ -4,6 +4,7 @@ pub struct TEST_STRUCT { pub ptr_32bit: *mut ::std::os::raw::c_void, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of TEST_STRUCT"][::std::mem::size_of::() - 8usize]; ["Alignment of TEST_STRUCT"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/struct_typedef_ns.rs b/bindgen-tests/tests/expectations/tests/libclang-9/struct_typedef_ns.rs index 34e44b7417..d93a62e746 100644 --- a/bindgen-tests/tests/expectations/tests/libclang-9/struct_typedef_ns.rs +++ b/bindgen-tests/tests/expectations/tests/libclang-9/struct_typedef_ns.rs @@ -11,6 +11,7 @@ pub mod root { pub struct typedef_struct { pub foo: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of typedef_struct"][::std::mem::size_of::() - 4usize]; [ @@ -34,6 +35,7 @@ pub mod root { pub struct _bindgen_ty_1 { pub foo: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _bindgen_ty_1"][::std::mem::size_of::<_bindgen_ty_1>() - 4usize]; [ diff --git a/bindgen-tests/tests/expectations/tests/mangling-linux32.rs b/bindgen-tests/tests/expectations/tests/mangling-linux32.rs index dd34ac92f7..ab1f799694 100644 --- a/bindgen-tests/tests/expectations/tests/mangling-linux32.rs +++ b/bindgen-tests/tests/expectations/tests/mangling-linux32.rs @@ -11,6 +11,7 @@ extern "C" { #[link_name = "\u{1}_ZN3Foo4sBarE"] pub static mut Foo_sBar: bool; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/mangling-linux64.rs b/bindgen-tests/tests/expectations/tests/mangling-linux64.rs index dd34ac92f7..ab1f799694 100644 --- a/bindgen-tests/tests/expectations/tests/mangling-linux64.rs +++ b/bindgen-tests/tests/expectations/tests/mangling-linux64.rs @@ -11,6 +11,7 @@ extern "C" { #[link_name = "\u{1}_ZN3Foo4sBarE"] pub static mut Foo_sBar: bool; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/mangling-macos.rs b/bindgen-tests/tests/expectations/tests/mangling-macos.rs index 8a95f99249..b5d78cedb5 100644 --- a/bindgen-tests/tests/expectations/tests/mangling-macos.rs +++ b/bindgen-tests/tests/expectations/tests/mangling-macos.rs @@ -11,6 +11,7 @@ extern "C" { #[link_name = "\u{1}__ZN3Foo4sBarE"] pub static mut Foo_sBar: bool; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/mangling-win32.rs b/bindgen-tests/tests/expectations/tests/mangling-win32.rs index dddbde0bc7..572b69962c 100644 --- a/bindgen-tests/tests/expectations/tests/mangling-win32.rs +++ b/bindgen-tests/tests/expectations/tests/mangling-win32.rs @@ -11,6 +11,7 @@ extern "C" { #[link_name = "\u{1}?sBar@Foo@@2_NA"] pub static mut Foo_sBar: bool; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/mangling-win64.rs b/bindgen-tests/tests/expectations/tests/mangling-win64.rs index 655992271d..1e71710f6c 100644 --- a/bindgen-tests/tests/expectations/tests/mangling-win64.rs +++ b/bindgen-tests/tests/expectations/tests/mangling-win64.rs @@ -11,6 +11,7 @@ extern "C" { #[link_name = "\u{1}?sBar@Foo@@2_NA"] pub static mut Foo_sBar: bool; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/merge-extern-blocks.rs b/bindgen-tests/tests/expectations/tests/merge-extern-blocks.rs index 0b2eb59af9..595d865af1 100644 --- a/bindgen-tests/tests/expectations/tests/merge-extern-blocks.rs +++ b/bindgen-tests/tests/expectations/tests/merge-extern-blocks.rs @@ -8,6 +8,7 @@ pub mod root { pub struct Point { pub x: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Point"][::std::mem::size_of::() - 4usize]; ["Alignment of Point"][::std::mem::align_of::() - 4usize]; @@ -21,6 +22,7 @@ pub mod root { pub struct Point { pub x: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Point"][::std::mem::size_of::() - 4usize]; ["Alignment of Point"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/method-mangling.rs b/bindgen-tests/tests/expectations/tests/method-mangling.rs index e7127376cd..bde0a0f2ff 100644 --- a/bindgen-tests/tests/expectations/tests/method-mangling.rs +++ b/bindgen-tests/tests/expectations/tests/method-mangling.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/module-allowlisted.rs b/bindgen-tests/tests/expectations/tests/module-allowlisted.rs index 257da9fb31..9ac408dc8f 100644 --- a/bindgen-tests/tests/expectations/tests/module-allowlisted.rs +++ b/bindgen-tests/tests/expectations/tests/module-allowlisted.rs @@ -8,6 +8,7 @@ pub mod root { pub struct Test { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test"][::std::mem::size_of::() - 1usize]; ["Alignment of Test"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/msvc-no-usr.rs b/bindgen-tests/tests/expectations/tests/msvc-no-usr.rs index 29363b07f7..adaa1a07b2 100644 --- a/bindgen-tests/tests/expectations/tests/msvc-no-usr.rs +++ b/bindgen-tests/tests/expectations/tests/msvc-no-usr.rs @@ -4,6 +4,7 @@ pub struct A { pub foo: usize, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 8usize]; ["Alignment of A"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs b/bindgen-tests/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs index b8963d6499..b0cf27451c 100644 --- a/bindgen-tests/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs +++ b/bindgen-tests/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; @@ -13,6 +14,7 @@ const _: () = { pub struct Bar { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 1usize]; ["Alignment of Bar"][::std::mem::align_of::() - 1usize]; @@ -22,6 +24,7 @@ const _: () = { pub struct Baz { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Baz"][::std::mem::size_of::() - 1usize]; ["Alignment of Baz"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/mutable.rs b/bindgen-tests/tests/expectations/tests/mutable.rs index ca59bd15cc..ff98d31f24 100644 --- a/bindgen-tests/tests/expectations/tests/mutable.rs +++ b/bindgen-tests/tests/expectations/tests/mutable.rs @@ -5,6 +5,7 @@ pub struct C { pub m_member: ::std::os::raw::c_int, pub m_other: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 8usize]; ["Alignment of C"][::std::mem::align_of::() - 4usize]; @@ -16,6 +17,7 @@ const _: () = { pub struct NonCopiable { pub m_member: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NonCopiable"][::std::mem::size_of::() - 4usize]; ["Alignment of NonCopiable"][::std::mem::align_of::() - 4usize]; @@ -28,6 +30,7 @@ const _: () = { pub struct NonCopiableWithNonCopiableMutableMember { pub m_member: NonCopiable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of NonCopiableWithNonCopiableMutableMember", diff --git a/bindgen-tests/tests/expectations/tests/namespace.rs b/bindgen-tests/tests/expectations/tests/namespace.rs index 93e201d329..f4f2a76c3e 100644 --- a/bindgen-tests/tests/expectations/tests/namespace.rs +++ b/bindgen-tests/tests/expectations/tests/namespace.rs @@ -25,6 +25,7 @@ pub mod root { pub struct A { pub b: root::whatever::whatever_int_t, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 4usize]; ["Alignment of A"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/nested.rs b/bindgen-tests/tests/expectations/tests/nested.rs index a083b7b341..5e0a8b07c8 100644 --- a/bindgen-tests/tests/expectations/tests/nested.rs +++ b/bindgen-tests/tests/expectations/tests/nested.rs @@ -4,6 +4,7 @@ pub struct Calc { pub w: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Calc"][::std::mem::size_of::() - 4usize]; ["Alignment of Calc"][::std::mem::align_of::() - 4usize]; @@ -25,6 +26,7 @@ pub struct Test_Size { pub struct Test_Size_Dimension { pub _base: Calc, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of Test_Size_Dimension", @@ -33,6 +35,7 @@ const _: () = { "Alignment of Test_Size_Dimension", ][::std::mem::align_of::() - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test_Size"][::std::mem::size_of::() - 8usize]; ["Alignment of Test_Size"][::std::mem::align_of::() - 4usize]; @@ -43,6 +46,7 @@ const _: () = { "Offset of field: Test_Size::mHeight", ][::std::mem::offset_of!(Test_Size, mHeight) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test"][::std::mem::size_of::() - 1usize]; ["Alignment of Test"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/nested_vtable.rs b/bindgen-tests/tests/expectations/tests/nested_vtable.rs index 7c4fd14f4f..6356f9efd1 100644 --- a/bindgen-tests/tests/expectations/tests/nested_vtable.rs +++ b/bindgen-tests/tests/expectations/tests/nested_vtable.rs @@ -10,6 +10,7 @@ pub struct nsISupports__bindgen_vtable { pub struct nsISupports { pub vtable_: *const nsISupports__bindgen_vtable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of nsISupports"][::std::mem::size_of::() - 8usize]; ["Alignment of nsISupports"][::std::mem::align_of::() - 8usize]; @@ -34,6 +35,7 @@ extern "C" { pub struct nsIRunnable { pub _base: nsISupports, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of nsIRunnable"][::std::mem::size_of::() - 8usize]; ["Alignment of nsIRunnable"][::std::mem::align_of::() - 8usize]; @@ -52,6 +54,7 @@ impl Default for nsIRunnable { pub struct Runnable { pub _base: nsIRunnable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Runnable"][::std::mem::size_of::() - 8usize]; ["Alignment of Runnable"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/nested_within_namespace.rs b/bindgen-tests/tests/expectations/tests/nested_within_namespace.rs index 1cc81efed9..f470571ddc 100644 --- a/bindgen-tests/tests/expectations/tests/nested_within_namespace.rs +++ b/bindgen-tests/tests/expectations/tests/nested_within_namespace.rs @@ -16,6 +16,7 @@ pub mod root { pub struct Bar_Baz { pub foo: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar_Baz"][::std::mem::size_of::() - 4usize]; ["Alignment of Bar_Baz"][::std::mem::align_of::() - 4usize]; @@ -23,6 +24,7 @@ pub mod root { "Offset of field: Bar_Baz::foo", ][::std::mem::offset_of!(Bar_Baz, foo) - 0usize]; }; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 4usize]; ["Alignment of Bar"][::std::mem::align_of::() - 4usize]; @@ -33,6 +35,7 @@ pub mod root { pub struct Baz { pub baz: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Baz"][::std::mem::size_of::() - 4usize]; ["Alignment of Baz"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no-comments.rs b/bindgen-tests/tests/expectations/tests/no-comments.rs index 20fa648a47..6a60973fb4 100644 --- a/bindgen-tests/tests/expectations/tests/no-comments.rs +++ b/bindgen-tests/tests/expectations/tests/no-comments.rs @@ -4,6 +4,7 @@ pub struct Foo { pub s: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 4usize]; ["Alignment of Foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no-derive-debug.rs b/bindgen-tests/tests/expectations/tests/no-derive-debug.rs index 9c58b9855b..5e525068fd 100644 --- a/bindgen-tests/tests/expectations/tests/no-derive-debug.rs +++ b/bindgen-tests/tests/expectations/tests/no-derive-debug.rs @@ -12,6 +12,7 @@ pub struct bar { pub foo: foo, pub baz: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar"][::std::mem::size_of::() - 8usize]; ["Alignment of bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no-derive-default.rs b/bindgen-tests/tests/expectations/tests/no-derive-default.rs index 3b2ebcc807..a1d86a6502 100644 --- a/bindgen-tests/tests/expectations/tests/no-derive-default.rs +++ b/bindgen-tests/tests/expectations/tests/no-derive-default.rs @@ -12,6 +12,7 @@ pub struct bar { pub foo: foo, pub baz: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar"][::std::mem::size_of::() - 8usize]; ["Alignment of bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no-hash-allowlisted.rs b/bindgen-tests/tests/expectations/tests/no-hash-allowlisted.rs index 538d2109d5..ff4dd1e38e 100644 --- a/bindgen-tests/tests/expectations/tests/no-hash-allowlisted.rs +++ b/bindgen-tests/tests/expectations/tests/no-hash-allowlisted.rs @@ -4,6 +4,7 @@ pub struct NoHash { pub i: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoHash"][::std::mem::size_of::() - 4usize]; ["Alignment of NoHash"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no-hash-opaque.rs b/bindgen-tests/tests/expectations/tests/no-hash-opaque.rs index b8869924b5..9dc9e01989 100644 --- a/bindgen-tests/tests/expectations/tests/no-hash-opaque.rs +++ b/bindgen-tests/tests/expectations/tests/no-hash-opaque.rs @@ -5,6 +5,7 @@ pub struct NoHash { pub _bindgen_opaque_blob: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoHash"][::std::mem::size_of::() - 4usize]; ["Alignment of NoHash"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no-partialeq-allowlisted.rs b/bindgen-tests/tests/expectations/tests/no-partialeq-allowlisted.rs index ad09f91cc9..68ae1a7449 100644 --- a/bindgen-tests/tests/expectations/tests/no-partialeq-allowlisted.rs +++ b/bindgen-tests/tests/expectations/tests/no-partialeq-allowlisted.rs @@ -4,6 +4,7 @@ pub struct NoPartialEq { pub i: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoPartialEq"][::std::mem::size_of::() - 4usize]; ["Alignment of NoPartialEq"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no-partialeq-opaque.rs b/bindgen-tests/tests/expectations/tests/no-partialeq-opaque.rs index f16b92f5d4..4b488df6a5 100644 --- a/bindgen-tests/tests/expectations/tests/no-partialeq-opaque.rs +++ b/bindgen-tests/tests/expectations/tests/no-partialeq-opaque.rs @@ -5,6 +5,7 @@ pub struct NoPartialEq { pub _bindgen_opaque_blob: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoPartialEq"][::std::mem::size_of::() - 4usize]; ["Alignment of NoPartialEq"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no-recursive-allowlisting.rs b/bindgen-tests/tests/expectations/tests/no-recursive-allowlisting.rs index 0fc566bc2a..dc1e4721ab 100644 --- a/bindgen-tests/tests/expectations/tests/no-recursive-allowlisting.rs +++ b/bindgen-tests/tests/expectations/tests/no-recursive-allowlisting.rs @@ -5,6 +5,7 @@ pub enum Bar {} pub struct Foo { pub baz: *mut Bar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 8usize]; ["Alignment of Foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/no-std.rs b/bindgen-tests/tests/expectations/tests/no-std.rs index 32defdf1f5..0f03c222ef 100644 --- a/bindgen-tests/tests/expectations/tests/no-std.rs +++ b/bindgen-tests/tests/expectations/tests/no-std.rs @@ -11,6 +11,7 @@ pub struct foo { pub b: libc::c_int, pub bar: *mut libc::c_void, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::core::mem::size_of::() - 16usize]; ["Alignment of foo"][::core::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/no_copy_allowlisted.rs b/bindgen-tests/tests/expectations/tests/no_copy_allowlisted.rs index 409dd56784..67be391799 100644 --- a/bindgen-tests/tests/expectations/tests/no_copy_allowlisted.rs +++ b/bindgen-tests/tests/expectations/tests/no_copy_allowlisted.rs @@ -4,6 +4,7 @@ pub struct NoCopy { pub i: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoCopy"][::std::mem::size_of::() - 4usize]; ["Alignment of NoCopy"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no_copy_opaque.rs b/bindgen-tests/tests/expectations/tests/no_copy_opaque.rs index 5cf9a9f65f..dea6a0a6cf 100644 --- a/bindgen-tests/tests/expectations/tests/no_copy_opaque.rs +++ b/bindgen-tests/tests/expectations/tests/no_copy_opaque.rs @@ -5,6 +5,7 @@ pub struct NoCopy { pub _bindgen_opaque_blob: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoCopy"][::std::mem::size_of::() - 4usize]; ["Alignment of NoCopy"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no_debug_allowlisted.rs b/bindgen-tests/tests/expectations/tests/no_debug_allowlisted.rs index 042a3f00ad..1ddb20a747 100644 --- a/bindgen-tests/tests/expectations/tests/no_debug_allowlisted.rs +++ b/bindgen-tests/tests/expectations/tests/no_debug_allowlisted.rs @@ -4,6 +4,7 @@ pub struct NoDebug { pub i: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoDebug"][::std::mem::size_of::() - 4usize]; ["Alignment of NoDebug"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no_debug_opaque.rs b/bindgen-tests/tests/expectations/tests/no_debug_opaque.rs index ca486739e0..0bb37ec711 100644 --- a/bindgen-tests/tests/expectations/tests/no_debug_opaque.rs +++ b/bindgen-tests/tests/expectations/tests/no_debug_opaque.rs @@ -5,6 +5,7 @@ pub struct NoDebug { pub _bindgen_opaque_blob: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoDebug"][::std::mem::size_of::() - 4usize]; ["Alignment of NoDebug"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no_default_allowlisted.rs b/bindgen-tests/tests/expectations/tests/no_default_allowlisted.rs index 379596a065..593e644343 100644 --- a/bindgen-tests/tests/expectations/tests/no_default_allowlisted.rs +++ b/bindgen-tests/tests/expectations/tests/no_default_allowlisted.rs @@ -4,6 +4,7 @@ pub struct NoDefault { pub i: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoDefault"][::std::mem::size_of::() - 4usize]; ["Alignment of NoDefault"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no_default_opaque.rs b/bindgen-tests/tests/expectations/tests/no_default_opaque.rs index 28cd7b8cb5..ba2f63f91c 100644 --- a/bindgen-tests/tests/expectations/tests/no_default_opaque.rs +++ b/bindgen-tests/tests/expectations/tests/no_default_opaque.rs @@ -5,6 +5,7 @@ pub struct NoDefault { pub _bindgen_opaque_blob: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NoDefault"][::std::mem::size_of::() - 4usize]; ["Alignment of NoDefault"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/no_size_t_is_usize.rs b/bindgen-tests/tests/expectations/tests/no_size_t_is_usize.rs index 326f0730a8..94ce735b31 100644 --- a/bindgen-tests/tests/expectations/tests/no_size_t_is_usize.rs +++ b/bindgen-tests/tests/expectations/tests/no_size_t_is_usize.rs @@ -8,6 +8,7 @@ pub struct A { pub offset: ssize_t, pub next: *mut A, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of A"][::std::mem::size_of::() - 24usize]; ["Alignment of A"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/non-type-params.rs b/bindgen-tests/tests/expectations/tests/non-type-params.rs index 6fa250455c..64b293cb1b 100644 --- a/bindgen-tests/tests/expectations/tests/non-type-params.rs +++ b/bindgen-tests/tests/expectations/tests/non-type-params.rs @@ -8,6 +8,7 @@ pub struct UsesArray { pub array_bool_8: [u8; 8usize], pub array_int_4: ArrayInt4, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of UsesArray"][::std::mem::size_of::() - 40usize]; ["Alignment of UsesArray"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/objc_interface_type.rs b/bindgen-tests/tests/expectations/tests/objc_interface_type.rs index 53c7101e7d..66c65be2d7 100644 --- a/bindgen-tests/tests/expectations/tests/objc_interface_type.rs +++ b/bindgen-tests/tests/expectations/tests/objc_interface_type.rs @@ -25,6 +25,7 @@ pub trait IFoo: Sized + std::ops::Deref {} pub struct FooStruct { pub foo: Foo, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of FooStruct"][::std::mem::size_of::() - 8usize]; ["Alignment of FooStruct"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/only_bitfields.rs b/bindgen-tests/tests/expectations/tests/only_bitfields.rs index f3c9658762..5cd01b4485 100644 --- a/bindgen-tests/tests/expectations/tests/only_bitfields.rs +++ b/bindgen-tests/tests/expectations/tests/only_bitfields.rs @@ -89,6 +89,7 @@ pub struct C { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 1usize]; ["Alignment of C"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/opaque-template-inst-member-2.rs b/bindgen-tests/tests/expectations/tests/opaque-template-inst-member-2.rs index 58b5004a4c..14718a9312 100644 --- a/bindgen-tests/tests/expectations/tests/opaque-template-inst-member-2.rs +++ b/bindgen-tests/tests/expectations/tests/opaque-template-inst-member-2.rs @@ -13,6 +13,7 @@ pub struct ContainsOpaqueTemplate { pub mBlah: u32, pub mBaz: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ContainsOpaqueTemplate", @@ -34,6 +35,7 @@ pub struct InheritsOpaqueTemplate { pub _base: u8, pub wow: *mut ::std::os::raw::c_char, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of InheritsOpaqueTemplate", diff --git a/bindgen-tests/tests/expectations/tests/opaque-template-instantiation-namespaced.rs b/bindgen-tests/tests/expectations/tests/opaque-template-instantiation-namespaced.rs index 2199785d9b..58644e053d 100644 --- a/bindgen-tests/tests/expectations/tests/opaque-template-instantiation-namespaced.rs +++ b/bindgen-tests/tests/expectations/tests/opaque-template-instantiation-namespaced.rs @@ -26,6 +26,7 @@ pub mod root { pub struct Foo { pub c: ::std::os::raw::c_char, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; @@ -36,6 +37,7 @@ pub mod root { pub struct Bar { pub i: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 4usize]; ["Alignment of Bar"][::std::mem::align_of::() - 4usize]; @@ -46,6 +48,7 @@ pub mod root { pub struct ContainsInstantiation { pub not_opaque: root::zoidberg::Template, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ContainsInstantiation", @@ -71,6 +74,7 @@ pub mod root { pub struct ContainsOpaqueInstantiation { pub opaque: u32, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ContainsOpaqueInstantiation", @@ -83,6 +87,7 @@ pub mod root { ][::std::mem::offset_of!(ContainsOpaqueInstantiation, opaque) - 0usize]; }; } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Template_open0_Foo_close0", diff --git a/bindgen-tests/tests/expectations/tests/opaque-template-instantiation.rs b/bindgen-tests/tests/expectations/tests/opaque-template-instantiation.rs index 83b4e08063..ab68c21856 100644 --- a/bindgen-tests/tests/expectations/tests/opaque-template-instantiation.rs +++ b/bindgen-tests/tests/expectations/tests/opaque-template-instantiation.rs @@ -19,6 +19,7 @@ impl Default for Template { pub struct ContainsInstantiation { pub not_opaque: Template<::std::os::raw::c_char>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ContainsInstantiation", @@ -44,6 +45,7 @@ impl Default for ContainsInstantiation { pub struct ContainsOpaqueInstantiation { pub opaque: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ContainsOpaqueInstantiation", @@ -55,6 +57,7 @@ const _: () = { "Offset of field: ContainsOpaqueInstantiation::opaque", ][::std::mem::offset_of!(ContainsOpaqueInstantiation, opaque) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Template_open0_char_close0", diff --git a/bindgen-tests/tests/expectations/tests/opaque-tracing.rs b/bindgen-tests/tests/expectations/tests/opaque-tracing.rs index 59afbf8ad9..c181dc90d6 100644 --- a/bindgen-tests/tests/expectations/tests/opaque-tracing.rs +++ b/bindgen-tests/tests/expectations/tests/opaque-tracing.rs @@ -9,6 +9,7 @@ extern "C" { pub struct Container { pub _bindgen_opaque_blob: [u32; 2usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Container"][::std::mem::size_of::() - 8usize]; ["Alignment of Container"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/opaque_in_struct.rs b/bindgen-tests/tests/expectations/tests/opaque_in_struct.rs index 1fb26f8406..b651cd3354 100644 --- a/bindgen-tests/tests/expectations/tests/opaque_in_struct.rs +++ b/bindgen-tests/tests/expectations/tests/opaque_in_struct.rs @@ -6,6 +6,7 @@ pub struct opaque { pub _bindgen_opaque_blob: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of opaque"][::std::mem::size_of::() - 4usize]; ["Alignment of opaque"][::std::mem::align_of::() - 4usize]; @@ -15,6 +16,7 @@ const _: () = { pub struct container { pub contained: opaque, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of container"][::std::mem::size_of::() - 4usize]; ["Alignment of container"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/opaque_pointer.rs b/bindgen-tests/tests/expectations/tests/opaque_pointer.rs index 9835e7f46e..ec519d9c6b 100644 --- a/bindgen-tests/tests/expectations/tests/opaque_pointer.rs +++ b/bindgen-tests/tests/expectations/tests/opaque_pointer.rs @@ -6,6 +6,7 @@ pub struct OtherOpaque { pub _bindgen_opaque_blob: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of OtherOpaque"][::std::mem::size_of::() - 4usize]; ["Alignment of OtherOpaque"][::std::mem::align_of::() - 4usize]; @@ -23,6 +24,7 @@ pub struct WithOpaquePtr { pub other: u32, pub t: OtherOpaque, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of WithOpaquePtr"][::std::mem::size_of::() - 16usize]; ["Alignment of WithOpaquePtr"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/packed-bitfield.rs b/bindgen-tests/tests/expectations/tests/packed-bitfield.rs index d788a4d5d4..852126ecfc 100644 --- a/bindgen-tests/tests/expectations/tests/packed-bitfield.rs +++ b/bindgen-tests/tests/expectations/tests/packed-bitfield.rs @@ -89,6 +89,7 @@ pub struct Date { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Date"][::std::mem::size_of::() - 3usize]; ["Alignment of Date"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/packed-n-with-padding.rs b/bindgen-tests/tests/expectations/tests/packed-n-with-padding.rs index cfb3bbec9b..162a1bebed 100644 --- a/bindgen-tests/tests/expectations/tests/packed-n-with-padding.rs +++ b/bindgen-tests/tests/expectations/tests/packed-n-with-padding.rs @@ -7,6 +7,7 @@ pub struct Packed { pub c: ::std::os::raw::c_char, pub d: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Packed"][::std::mem::size_of::() - 10usize]; ["Alignment of Packed"][::std::mem::align_of::() - 2usize]; diff --git a/bindgen-tests/tests/expectations/tests/parm-union.rs b/bindgen-tests/tests/expectations/tests/parm-union.rs index 85c4718aa2..9c4f2f4e25 100644 --- a/bindgen-tests/tests/expectations/tests/parm-union.rs +++ b/bindgen-tests/tests/expectations/tests/parm-union.rs @@ -4,6 +4,7 @@ pub struct Struct { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Struct"][::std::mem::size_of::() - 1usize]; ["Alignment of Struct"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/partial-specialization-and-inheritance.rs b/bindgen-tests/tests/expectations/tests/partial-specialization-and-inheritance.rs index bb28bffcae..e7c9a38d7f 100644 --- a/bindgen-tests/tests/expectations/tests/partial-specialization-and-inheritance.rs +++ b/bindgen-tests/tests/expectations/tests/partial-specialization-and-inheritance.rs @@ -18,6 +18,7 @@ extern "C" { #[link_name = "\u{1}_ZN5Usage13static_memberE"] pub static mut Usage_static_member: [u32; 2usize]; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Usage"][::std::mem::size_of::() - 1usize]; ["Alignment of Usage"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/private.rs b/bindgen-tests/tests/expectations/tests/private.rs index 86d0120e04..bf1e853e6a 100644 --- a/bindgen-tests/tests/expectations/tests/private.rs +++ b/bindgen-tests/tests/expectations/tests/private.rs @@ -6,6 +6,7 @@ pub struct HasPrivate { ///
mIsPrivate: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of HasPrivate"][::std::mem::size_of::() - 8usize]; ["Alignment of HasPrivate"][::std::mem::align_of::() - 4usize]; @@ -23,6 +24,7 @@ pub struct VeryPrivate { mIsPrivate: ::std::os::raw::c_int, mIsAlsoPrivate: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of VeryPrivate"][::std::mem::size_of::() - 8usize]; ["Alignment of VeryPrivate"][::std::mem::align_of::() - 4usize]; @@ -41,6 +43,7 @@ pub struct ContradictPrivate { pub mNotPrivate: ::std::os::raw::c_int, mIsPrivate: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ContradictPrivate"][::std::mem::size_of::() - 8usize]; [ diff --git a/bindgen-tests/tests/expectations/tests/private_fields.rs b/bindgen-tests/tests/expectations/tests/private_fields.rs index 88e4797c73..5a7bee9508 100644 --- a/bindgen-tests/tests/expectations/tests/private_fields.rs +++ b/bindgen-tests/tests/expectations/tests/private_fields.rs @@ -89,6 +89,7 @@ pub struct PubPriv { pub x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PubPriv"][::std::mem::size_of::() - 8usize]; ["Alignment of PubPriv"][::std::mem::align_of::() - 4usize]; @@ -103,6 +104,7 @@ pub struct PrivateBitFields { _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub __bindgen_padding_0: [u8; 3usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PrivateBitFields"][::std::mem::size_of::() - 4usize]; [ @@ -167,6 +169,7 @@ pub struct PublicBitFields { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub __bindgen_padding_0: [u8; 3usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PublicBitFields"][::std::mem::size_of::() - 4usize]; ["Alignment of PublicBitFields"][::std::mem::align_of::() - 4usize]; @@ -229,6 +232,7 @@ pub struct MixedBitFields { _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub __bindgen_padding_0: [u8; 3usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of MixedBitFields"][::std::mem::size_of::() - 4usize]; ["Alignment of MixedBitFields"][::std::mem::align_of::() - 4usize]; @@ -288,6 +292,7 @@ impl MixedBitFields { pub struct Base { pub member: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Base"][::std::mem::size_of::() - 4usize]; ["Alignment of Base"][::std::mem::align_of::() - 4usize]; @@ -298,6 +303,7 @@ const _: () = { pub struct InheritsPrivately { _base: Base, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of InheritsPrivately"][::std::mem::size_of::() - 4usize]; [ @@ -309,6 +315,7 @@ const _: () = { pub struct InheritsPublically { pub _base: Base, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of InheritsPublically"][::std::mem::size_of::() - 4usize]; [ @@ -326,6 +333,7 @@ pub struct WithAnonStruct { pub struct WithAnonStruct__bindgen_ty_1 { pub a: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of WithAnonStruct__bindgen_ty_1", @@ -342,6 +350,7 @@ const _: () = { pub struct WithAnonStruct__bindgen_ty_2 { pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of WithAnonStruct__bindgen_ty_2", @@ -353,6 +362,7 @@ const _: () = { "Offset of field: WithAnonStruct__bindgen_ty_2::b", ][::std::mem::offset_of!(WithAnonStruct__bindgen_ty_2, b) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of WithAnonStruct"][::std::mem::size_of::() - 8usize]; ["Alignment of WithAnonStruct"][::std::mem::align_of::() - 4usize]; @@ -367,6 +377,7 @@ pub struct WithAnonUnion { pub union WithAnonUnion__bindgen_ty_1 { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of WithAnonUnion__bindgen_ty_1", @@ -384,6 +395,7 @@ impl Default for WithAnonUnion__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of WithAnonUnion"][::std::mem::size_of::() - 1usize]; ["Alignment of WithAnonUnion"][::std::mem::align_of::() - 1usize]; @@ -408,6 +420,7 @@ pub struct Override { _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, pub __bindgen_padding_0: u16, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Override"][::std::mem::size_of::() - 16usize]; ["Alignment of Override"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/ptr32-has-different-size.rs b/bindgen-tests/tests/expectations/tests/ptr32-has-different-size.rs index d03d66f1a4..f4f3ab4294 100644 --- a/bindgen-tests/tests/expectations/tests/ptr32-has-different-size.rs +++ b/bindgen-tests/tests/expectations/tests/ptr32-has-different-size.rs @@ -4,6 +4,7 @@ pub struct TEST_STRUCT { pub ptr_32bit: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of TEST_STRUCT"][::std::mem::size_of::() - 4usize]; ["Alignment of TEST_STRUCT"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/public-dtor.rs b/bindgen-tests/tests/expectations/tests/public-dtor.rs index fc9e85ced0..c271125097 100644 --- a/bindgen-tests/tests/expectations/tests/public-dtor.rs +++ b/bindgen-tests/tests/expectations/tests/public-dtor.rs @@ -4,6 +4,7 @@ pub struct cv_Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of cv_Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of cv_Foo"][::std::mem::align_of::() - 1usize]; @@ -23,6 +24,7 @@ impl cv_Foo { pub struct cv_Bar { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of cv_Bar"][::std::mem::size_of::() - 1usize]; ["Alignment of cv_Bar"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/redundant-packed-and-align.rs b/bindgen-tests/tests/expectations/tests/redundant-packed-and-align.rs index f4f2b95408..6e7db24870 100644 --- a/bindgen-tests/tests/expectations/tests/redundant-packed-and-align.rs +++ b/bindgen-tests/tests/expectations/tests/redundant-packed-and-align.rs @@ -90,6 +90,7 @@ pub struct redundant_packed { pub a: u32, pub b: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of redundant_packed"][::std::mem::size_of::() - 8usize]; [ @@ -111,6 +112,7 @@ pub struct redundant_packed_bitfield { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub c: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of redundant_packed_bitfield", @@ -179,6 +181,7 @@ pub union redundant_packed_union { pub a: u64, pub b: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of redundant_packed_union", @@ -208,6 +211,7 @@ impl Default for redundant_packed_union { pub struct inner { pub a: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of inner"][::std::mem::size_of::() - 2usize]; ["Alignment of inner"][::std::mem::align_of::() - 2usize]; @@ -220,6 +224,7 @@ pub struct outer_redundant_packed { pub a: [inner; 2usize], pub b: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of outer_redundant_packed", @@ -241,6 +246,7 @@ pub struct redundant_pragma_packed { pub a: u8, pub b: u16, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of redundant_pragma_packed", diff --git a/bindgen-tests/tests/expectations/tests/ref_argument_array.rs b/bindgen-tests/tests/expectations/tests/ref_argument_array.rs index 855fdec6ed..de5f81c3c0 100644 --- a/bindgen-tests/tests/expectations/tests/ref_argument_array.rs +++ b/bindgen-tests/tests/expectations/tests/ref_argument_array.rs @@ -12,6 +12,7 @@ pub struct nsID__bindgen_vtable { pub struct nsID { pub vtable_: *const nsID__bindgen_vtable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of nsID"][::std::mem::size_of::() - 8usize]; ["Alignment of nsID"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/reparented_replacement.rs b/bindgen-tests/tests/expectations/tests/reparented_replacement.rs index 48ad6f3f5b..9b2cc33ce9 100644 --- a/bindgen-tests/tests/expectations/tests/reparented_replacement.rs +++ b/bindgen-tests/tests/expectations/tests/reparented_replacement.rs @@ -12,6 +12,7 @@ pub mod root { pub struct Bar { pub bazz: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 4usize]; ["Alignment of Bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/replace_use.rs b/bindgen-tests/tests/expectations/tests/replace_use.rs index d7d4e33536..ebf9657176 100644 --- a/bindgen-tests/tests/expectations/tests/replace_use.rs +++ b/bindgen-tests/tests/expectations/tests/replace_use.rs @@ -10,11 +10,13 @@ pub struct nsTArray { pub struct Test { pub a: nsTArray, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test"][::std::mem::size_of::() - 4usize]; ["Alignment of Test"][::std::mem::align_of::() - 4usize]; ["Offset of field: Test::a"][::std::mem::offset_of!(Test, a) - 0usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: nsTArray_open0_long_close0", diff --git a/bindgen-tests/tests/expectations/tests/same_struct_name_in_different_namespaces.rs b/bindgen-tests/tests/expectations/tests/same_struct_name_in_different_namespaces.rs index 9fb546fc0c..e6e4088abf 100644 --- a/bindgen-tests/tests/expectations/tests/same_struct_name_in_different_namespaces.rs +++ b/bindgen-tests/tests/expectations/tests/same_struct_name_in_different_namespaces.rs @@ -10,6 +10,7 @@ pub struct JS_shadow_Zone { pub x: ::std::os::raw::c_int, pub y: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of JS_shadow_Zone"][::std::mem::size_of::() - 8usize]; ["Alignment of JS_shadow_Zone"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/sentry-defined-multiple-times.rs b/bindgen-tests/tests/expectations/tests/sentry-defined-multiple-times.rs index 0d9d3a47ef..0fe153e700 100644 --- a/bindgen-tests/tests/expectations/tests/sentry-defined-multiple-times.rs +++ b/bindgen-tests/tests/expectations/tests/sentry-defined-multiple-times.rs @@ -21,6 +21,7 @@ pub mod root { pub struct sentry { pub i_am_plain_sentry: bool, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of sentry"][::std::mem::size_of::() - 1usize]; ["Alignment of sentry"][::std::mem::align_of::() - 1usize]; @@ -33,6 +34,7 @@ pub mod root { pub struct NotTemplateWrapper { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of NotTemplateWrapper", @@ -46,6 +48,7 @@ pub mod root { pub struct NotTemplateWrapper_sentry { pub i_am_not_template_wrapper_sentry: ::std::os::raw::c_char, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of NotTemplateWrapper_sentry", @@ -69,6 +72,7 @@ pub mod root { pub struct InlineNotTemplateWrapper_sentry { pub i_am_inline_not_template_wrapper_sentry: bool, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of InlineNotTemplateWrapper_sentry", @@ -82,6 +86,7 @@ pub mod root { InlineNotTemplateWrapper_sentry, i_am_inline_not_template_wrapper_sentry ) - 0usize]; }; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of InlineNotTemplateWrapper", @@ -110,6 +115,7 @@ pub mod root { pub struct OuterDoubleWrapper_InnerDoubleWrapper { pub _address: u8, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of OuterDoubleWrapper_InnerDoubleWrapper", @@ -118,6 +124,7 @@ pub mod root { "Alignment of OuterDoubleWrapper_InnerDoubleWrapper", ][::std::mem::align_of::() - 1usize]; }; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of OuterDoubleWrapper", @@ -131,6 +138,7 @@ pub mod root { pub struct OuterDoubleWrapper_InnerDoubleWrapper_sentry { pub i_am_double_wrapper_sentry: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of OuterDoubleWrapper_InnerDoubleWrapper_sentry", @@ -161,6 +169,7 @@ pub mod root { pub struct OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry { pub i_am_double_wrapper_inline_sentry: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry", @@ -179,6 +188,7 @@ pub mod root { i_am_double_wrapper_inline_sentry ) - 0usize]; }; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of OuterDoubleInlineWrapper_InnerDoubleInlineWrapper", @@ -189,6 +199,7 @@ pub mod root { ][::std::mem::align_of::() - 1usize]; }; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of OuterDoubleInlineWrapper", @@ -213,6 +224,7 @@ pub mod root { pub struct sentry { pub i_am_outside_namespace_sentry: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of sentry"][::std::mem::size_of::() - 4usize]; ["Alignment of sentry"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/size_t_template.rs b/bindgen-tests/tests/expectations/tests/size_t_template.rs index 7ca85c2ca1..e422131ca7 100644 --- a/bindgen-tests/tests/expectations/tests/size_t_template.rs +++ b/bindgen-tests/tests/expectations/tests/size_t_template.rs @@ -4,6 +4,7 @@ pub struct C { pub arr: [u32; 3usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 12usize]; ["Alignment of C"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/sorted_items.rs b/bindgen-tests/tests/expectations/tests/sorted_items.rs index ab2a6dc27a..5f1505bd86 100644 --- a/bindgen-tests/tests/expectations/tests/sorted_items.rs +++ b/bindgen-tests/tests/expectations/tests/sorted_items.rs @@ -14,12 +14,14 @@ pub mod root { pub a: root::number, pub b: root::number, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Point"][::std::mem::size_of::() - 8usize]; ["Alignment of Point"][::std::mem::align_of::() - 4usize]; ["Offset of field: Point::x"][::std::mem::offset_of!(Point, x) - 0usize]; ["Offset of field: Point::y"][::std::mem::offset_of!(Point, y) - 4usize]; }; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Angle"][::std::mem::size_of::() - 8usize]; ["Alignment of Angle"][::std::mem::align_of::() - 4usize]; @@ -41,12 +43,14 @@ pub mod root { pub a: root::ns::number, pub b: root::ns::number, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Point"][::std::mem::size_of::() - 8usize]; ["Alignment of Point"][::std::mem::align_of::() - 4usize]; ["Offset of field: Point::x"][::std::mem::offset_of!(Point, x) - 0usize]; ["Offset of field: Point::y"][::std::mem::offset_of!(Point, y) - 4usize]; }; + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Angle"][::std::mem::size_of::() - 8usize]; ["Alignment of Angle"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/stdint_typedef.rs b/bindgen-tests/tests/expectations/tests/stdint_typedef.rs index 67c0ea5685..8594727dfa 100644 --- a/bindgen-tests/tests/expectations/tests/stdint_typedef.rs +++ b/bindgen-tests/tests/expectations/tests/stdint_typedef.rs @@ -7,6 +7,7 @@ extern "C" { pub struct Struct { pub field: u64, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Struct"][::std::mem::size_of::() - 8usize]; ["Alignment of Struct"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_containing_forward_declared_struct.rs b/bindgen-tests/tests/expectations/tests/struct_containing_forward_declared_struct.rs index 39880f2f5a..0fe9024a5f 100644 --- a/bindgen-tests/tests/expectations/tests/struct_containing_forward_declared_struct.rs +++ b/bindgen-tests/tests/expectations/tests/struct_containing_forward_declared_struct.rs @@ -4,6 +4,7 @@ pub struct a { pub val_a: *mut b, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of a"][::std::mem::size_of::
() - 8usize]; ["Alignment of a"][::std::mem::align_of::() - 8usize]; @@ -23,6 +24,7 @@ impl Default for a { pub struct b { pub val_b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of b"][::std::mem::size_of::() - 4usize]; ["Alignment of b"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_typedef.rs b/bindgen-tests/tests/expectations/tests/struct_typedef.rs index efcea67c39..bc12a1bce8 100644 --- a/bindgen-tests/tests/expectations/tests/struct_typedef.rs +++ b/bindgen-tests/tests/expectations/tests/struct_typedef.rs @@ -4,6 +4,7 @@ pub struct typedef_named_struct { pub has_name: bool, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of typedef_named_struct", @@ -20,6 +21,7 @@ const _: () = { pub struct _bindgen_ty_1 { pub no_name: *mut ::std::os::raw::c_void, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _bindgen_ty_1"][::std::mem::size_of::<_bindgen_ty_1>() - 8usize]; ["Alignment of _bindgen_ty_1"][::std::mem::align_of::<_bindgen_ty_1>() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_typedef_ns.rs b/bindgen-tests/tests/expectations/tests/struct_typedef_ns.rs index 14091c9dc6..82f93dfd16 100644 --- a/bindgen-tests/tests/expectations/tests/struct_typedef_ns.rs +++ b/bindgen-tests/tests/expectations/tests/struct_typedef_ns.rs @@ -11,6 +11,7 @@ pub mod root { pub struct typedef_struct { pub foo: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of typedef_struct"][::std::mem::size_of::() - 4usize]; [ @@ -34,6 +35,7 @@ pub mod root { pub struct typedef_struct { pub foo: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of typedef_struct"][::std::mem::size_of::() - 4usize]; [ diff --git a/bindgen-tests/tests/expectations/tests/struct_with_anon_struct.rs b/bindgen-tests/tests/expectations/tests/struct_with_anon_struct.rs index f279a61378..51aa19c572 100644 --- a/bindgen-tests/tests/expectations/tests/struct_with_anon_struct.rs +++ b/bindgen-tests/tests/expectations/tests/struct_with_anon_struct.rs @@ -10,6 +10,7 @@ pub struct foo__bindgen_ty_1 { pub a: ::std::os::raw::c_int, pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; [ @@ -22,6 +23,7 @@ const _: () = { "Offset of field: foo__bindgen_ty_1::b", ][::std::mem::offset_of!(foo__bindgen_ty_1, b) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 8usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_with_anon_struct_array.rs b/bindgen-tests/tests/expectations/tests/struct_with_anon_struct_array.rs index 48fb6ac03e..930e6b9aba 100644 --- a/bindgen-tests/tests/expectations/tests/struct_with_anon_struct_array.rs +++ b/bindgen-tests/tests/expectations/tests/struct_with_anon_struct_array.rs @@ -11,6 +11,7 @@ pub struct foo__bindgen_ty_1 { pub a: ::std::os::raw::c_int, pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; [ @@ -29,6 +30,7 @@ pub struct foo__bindgen_ty_2 { pub a: ::std::os::raw::c_int, pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_2"][::std::mem::size_of::() - 8usize]; [ @@ -41,6 +43,7 @@ const _: () = { "Offset of field: foo__bindgen_ty_2::b", ][::std::mem::offset_of!(foo__bindgen_ty_2, b) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 208usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_with_anon_struct_pointer.rs b/bindgen-tests/tests/expectations/tests/struct_with_anon_struct_pointer.rs index 04b78064aa..6bdee34590 100644 --- a/bindgen-tests/tests/expectations/tests/struct_with_anon_struct_pointer.rs +++ b/bindgen-tests/tests/expectations/tests/struct_with_anon_struct_pointer.rs @@ -10,6 +10,7 @@ pub struct foo__bindgen_ty_1 { pub a: ::std::os::raw::c_int, pub b: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; [ @@ -22,6 +23,7 @@ const _: () = { "Offset of field: foo__bindgen_ty_1::b", ][::std::mem::offset_of!(foo__bindgen_ty_1, b) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 8usize]; ["Alignment of foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_with_anon_union.rs b/bindgen-tests/tests/expectations/tests/struct_with_anon_union.rs index 5cd95f777f..6520163259 100644 --- a/bindgen-tests/tests/expectations/tests/struct_with_anon_union.rs +++ b/bindgen-tests/tests/expectations/tests/struct_with_anon_union.rs @@ -10,6 +10,7 @@ pub union foo__bindgen_ty_1 { pub a: ::std::os::raw::c_uint, pub b: ::std::os::raw::c_ushort, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; [ @@ -31,6 +32,7 @@ impl Default for foo__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_with_anon_unnamed_struct.rs b/bindgen-tests/tests/expectations/tests/struct_with_anon_unnamed_struct.rs index 4e4a3f2d74..29cf382e5f 100644 --- a/bindgen-tests/tests/expectations/tests/struct_with_anon_unnamed_struct.rs +++ b/bindgen-tests/tests/expectations/tests/struct_with_anon_unnamed_struct.rs @@ -10,6 +10,7 @@ pub struct foo__bindgen_ty_1 { pub a: ::std::os::raw::c_uint, pub b: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; [ @@ -22,6 +23,7 @@ const _: () = { "Offset of field: foo__bindgen_ty_1::b", ][::std::mem::offset_of!(foo__bindgen_ty_1, b) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 8usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_with_anon_unnamed_union.rs b/bindgen-tests/tests/expectations/tests/struct_with_anon_unnamed_union.rs index 325aa820bf..2f95e0f5e0 100644 --- a/bindgen-tests/tests/expectations/tests/struct_with_anon_unnamed_union.rs +++ b/bindgen-tests/tests/expectations/tests/struct_with_anon_unnamed_union.rs @@ -10,6 +10,7 @@ pub union foo__bindgen_ty_1 { pub a: ::std::os::raw::c_uint, pub b: ::std::os::raw::c_ushort, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; [ @@ -31,6 +32,7 @@ impl Default for foo__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_with_bitfields.rs b/bindgen-tests/tests/expectations/tests/struct_with_bitfields.rs index 9ec90061b3..fb21433415 100644 --- a/bindgen-tests/tests/expectations/tests/struct_with_bitfields.rs +++ b/bindgen-tests/tests/expectations/tests/struct_with_bitfields.rs @@ -92,6 +92,7 @@ pub struct bitfield { pub _bitfield_align_2: [u32; 0], pub _bitfield_2: __BindgenBitfieldUnit<[u8; 8usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bitfield"][::std::mem::size_of::() - 16usize]; ["Alignment of bitfield"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_with_nesting.rs b/bindgen-tests/tests/expectations/tests/struct_with_nesting.rs index ec3a07f613..369384e88c 100644 --- a/bindgen-tests/tests/expectations/tests/struct_with_nesting.rs +++ b/bindgen-tests/tests/expectations/tests/struct_with_nesting.rs @@ -18,6 +18,7 @@ pub struct foo__bindgen_ty_1__bindgen_ty_1 { pub c1: ::std::os::raw::c_ushort, pub c2: ::std::os::raw::c_ushort, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of foo__bindgen_ty_1__bindgen_ty_1", @@ -40,6 +41,7 @@ pub struct foo__bindgen_ty_1__bindgen_ty_2 { pub d3: ::std::os::raw::c_uchar, pub d4: ::std::os::raw::c_uchar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of foo__bindgen_ty_1__bindgen_ty_2", @@ -60,6 +62,7 @@ const _: () = { "Offset of field: foo__bindgen_ty_1__bindgen_ty_2::d4", ][::std::mem::offset_of!(foo__bindgen_ty_1__bindgen_ty_2, d4) - 3usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; [ @@ -78,6 +81,7 @@ impl Default for foo__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 8usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_with_packing.rs b/bindgen-tests/tests/expectations/tests/struct_with_packing.rs index 2d041a4678..2687f9750b 100644 --- a/bindgen-tests/tests/expectations/tests/struct_with_packing.rs +++ b/bindgen-tests/tests/expectations/tests/struct_with_packing.rs @@ -5,6 +5,7 @@ pub struct a { pub b: ::std::os::raw::c_char, pub c: ::std::os::raw::c_short, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of a"][::std::mem::size_of::() - 3usize]; ["Alignment of a"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/struct_with_struct.rs b/bindgen-tests/tests/expectations/tests/struct_with_struct.rs index 13bd782e87..40c3972600 100644 --- a/bindgen-tests/tests/expectations/tests/struct_with_struct.rs +++ b/bindgen-tests/tests/expectations/tests/struct_with_struct.rs @@ -10,6 +10,7 @@ pub struct foo__bindgen_ty_1 { pub x: ::std::os::raw::c_uint, pub y: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; [ @@ -22,6 +23,7 @@ const _: () = { "Offset of field: foo__bindgen_ty_1::y", ][::std::mem::offset_of!(foo__bindgen_ty_1, y) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 8usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/template.rs b/bindgen-tests/tests/expectations/tests/template.rs index 13c9f0066e..aa2a7753e2 100644 --- a/bindgen-tests/tests/expectations/tests/template.rs +++ b/bindgen-tests/tests/expectations/tests/template.rs @@ -60,6 +60,7 @@ pub struct C { pub mArrayRef: B<*mut [::std::os::raw::c_int; 1usize]>, pub mBConstArray: B<[::std::os::raw::c_int; 1usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 104usize]; ["Alignment of C"][::std::mem::align_of::() - 8usize]; @@ -152,6 +153,7 @@ impl Default for Rooted { pub struct RootedContainer { pub root: Rooted<*mut ::std::os::raw::c_void>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of RootedContainer"][::std::mem::size_of::() - 24usize]; ["Alignment of RootedContainer"][::std::mem::align_of::() - 8usize]; @@ -189,6 +191,7 @@ impl Default for WithDtor { pub struct PODButContainsDtor { pub member: WithDtorIntFwd, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PODButContainsDtor"][::std::mem::size_of::() - 4usize]; [ @@ -218,6 +221,7 @@ pub struct Opaque { pub struct POD { pub opaque_member: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of POD"][::std::mem::size_of::() - 4usize]; ["Alignment of POD"][::std::mem::align_of::() - 4usize]; @@ -293,6 +297,7 @@ impl Default for Incomplete { pub struct Untemplated { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Untemplated"][::std::mem::size_of::() - 1usize]; ["Alignment of Untemplated"][::std::mem::align_of::() - 1usize]; @@ -370,6 +375,7 @@ impl Default for ReplacedWithoutDestructorFwd { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Foo_open0_int_int_close0", @@ -378,6 +384,7 @@ const _: () = { "Align of template specialization: Foo_open0_int_int_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_unsigned_int_close0", @@ -386,6 +393,7 @@ const _: () = { "Align of template specialization: B_open0_unsigned_int_close0", ][::std::mem::align_of::>() - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_ptr_const_int_close0", @@ -394,6 +402,7 @@ const _: () = { "Align of template specialization: B_open0_ptr_const_int_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_ptr_const_mozilla__Foo_close0", @@ -402,6 +411,7 @@ const _: () = { "Align of template specialization: B_open0_ptr_const_mozilla__Foo_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_array1_ptr_const_mozilla__Foo_close0", @@ -410,6 +420,7 @@ const _: () = { "Align of template specialization: B_open0_array1_ptr_const_mozilla__Foo_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_const_int_close0", @@ -418,6 +429,7 @@ const _: () = { "Align of template specialization: B_open0_const_int_close0", ][::std::mem::align_of::>() - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_volatile_int_close0", @@ -426,6 +438,7 @@ const _: () = { "Align of template specialization: B_open0_volatile_int_close0", ][::std::mem::align_of::>() - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_const_bool_close0", @@ -434,6 +447,7 @@ const _: () = { "Align of template specialization: B_open0_const_bool_close0", ][::std::mem::align_of::>() - 1usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_const_char16_t_close0", @@ -442,6 +456,7 @@ const _: () = { "Align of template specialization: B_open0_const_char16_t_close0", ][::std::mem::align_of::>() - 2usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_array1_int_close0", @@ -450,6 +465,7 @@ const _: () = { "Align of template specialization: B_open0_array1_int_close0", ][::std::mem::align_of::>() - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_array1_ptr_int_close0", @@ -458,6 +474,7 @@ const _: () = { "Align of template specialization: B_open0_array1_ptr_int_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_ptr_array1_int_close0", @@ -466,6 +483,7 @@ const _: () = { "Align of template specialization: B_open0_ptr_array1_int_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_ref_int_close0", @@ -474,6 +492,7 @@ const _: () = { "Align of template specialization: B_open0_ref_int_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_ref_const_int_close0", @@ -482,6 +501,7 @@ const _: () = { "Align of template specialization: B_open0_ref_const_int_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_ref_ptr_int_close0", @@ -490,6 +510,7 @@ const _: () = { "Align of template specialization: B_open0_ref_ptr_int_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_ref_array1_int_close0", @@ -498,6 +519,7 @@ const _: () = { "Align of template specialization: B_open0_ref_array1_int_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: B_open0_array1_const_int_close0", @@ -506,6 +528,7 @@ const _: () = { "Align of template specialization: B_open0_array1_const_int_close0", ][::std::mem::align_of::>() - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Foo_open0_int_int_close0", @@ -514,6 +537,7 @@ const _: () = { "Align of template specialization: Foo_open0_int_int_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Rooted_open0_ptr_void_close0", @@ -522,6 +546,7 @@ const _: () = { "Align of template specialization: Rooted_open0_ptr_void_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Rooted_open0_ptr_void_close0", @@ -530,6 +555,7 @@ const _: () = { "Align of template specialization: Rooted_open0_ptr_void_close0", ][::std::mem::align_of::>() - 8usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: WithDtor_open0_int_close0", diff --git a/bindgen-tests/tests/expectations/tests/template_instantiation_with_fn_local_type.rs b/bindgen-tests/tests/expectations/tests/template_instantiation_with_fn_local_type.rs index f152f1ae8e..0bf9cc6d82 100644 --- a/bindgen-tests/tests/expectations/tests/template_instantiation_with_fn_local_type.rs +++ b/bindgen-tests/tests/expectations/tests/template_instantiation_with_fn_local_type.rs @@ -8,6 +8,7 @@ extern "C" { #[link_name = "\u{1}_Z1fv"] pub fn f(); } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Foo_open0_Bar_close0", @@ -21,10 +22,12 @@ const _: () = { pub struct Baz { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Baz"][::std::mem::size_of::() - 1usize]; ["Alignment of Baz"][::std::mem::align_of::() - 1usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: Foo_open0_Boo_close0", @@ -38,6 +41,7 @@ const _: () = { pub struct Bar { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 1usize]; ["Alignment of Bar"][::std::mem::align_of::() - 1usize]; @@ -47,6 +51,7 @@ const _: () = { pub struct Boo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Boo"][::std::mem::size_of::() - 1usize]; ["Alignment of Boo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/test_mixed_header_and_header_contents.rs b/bindgen-tests/tests/expectations/tests/test_mixed_header_and_header_contents.rs index fe346d112f..a2910b9b24 100644 --- a/bindgen-tests/tests/expectations/tests/test_mixed_header_and_header_contents.rs +++ b/bindgen-tests/tests/expectations/tests/test_mixed_header_and_header_contents.rs @@ -31,6 +31,7 @@ pub struct Test { pub Ccu: UChar, pub Ccd: SChar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test"][::std::mem::size_of::() - 12usize]; ["Alignment of Test"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/test_multiple_header_calls_in_builder.rs b/bindgen-tests/tests/expectations/tests/test_multiple_header_calls_in_builder.rs index 92122d1714..bcc27d259f 100644 --- a/bindgen-tests/tests/expectations/tests/test_multiple_header_calls_in_builder.rs +++ b/bindgen-tests/tests/expectations/tests/test_multiple_header_calls_in_builder.rs @@ -25,6 +25,7 @@ pub struct Test { pub Ccu: UChar, pub Ccd: SChar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Test"][::std::mem::size_of::() - 12usize]; ["Alignment of Test"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/timex.rs b/bindgen-tests/tests/expectations/tests/timex.rs index cece8f099d..a9f78066f0 100644 --- a/bindgen-tests/tests/expectations/tests/timex.rs +++ b/bindgen-tests/tests/expectations/tests/timex.rs @@ -90,6 +90,7 @@ pub struct timex { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 44usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of timex"][::std::mem::size_of::() - 48usize]; ["Alignment of timex"][::std::mem::align_of::() - 4usize]; @@ -111,6 +112,7 @@ pub struct timex_named { pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 44usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of timex_named"][::std::mem::size_of::() - 48usize]; ["Alignment of timex_named"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/type-referenced-by-allowlisted-function.rs b/bindgen-tests/tests/expectations/tests/type-referenced-by-allowlisted-function.rs index 7d0973f994..8ddfaa7c68 100644 --- a/bindgen-tests/tests/expectations/tests/type-referenced-by-allowlisted-function.rs +++ b/bindgen-tests/tests/expectations/tests/type-referenced-by-allowlisted-function.rs @@ -4,6 +4,7 @@ pub struct dl_phdr_info { pub x: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of dl_phdr_info"][::std::mem::size_of::() - 4usize]; ["Alignment of dl_phdr_info"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/type_alias_template_specialized.rs b/bindgen-tests/tests/expectations/tests/type_alias_template_specialized.rs index bcd6c43af7..13e3f8139c 100644 --- a/bindgen-tests/tests/expectations/tests/type_alias_template_specialized.rs +++ b/bindgen-tests/tests/expectations/tests/type_alias_template_specialized.rs @@ -4,6 +4,7 @@ pub struct Rooted { pub ptr: MaybeWrapped<::std::os::raw::c_int>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Rooted"][::std::mem::size_of::() - 4usize]; ["Alignment of Rooted"][::std::mem::align_of::() - 4usize]; @@ -20,6 +21,7 @@ impl Default for Rooted { } ///
pub type MaybeWrapped
= a; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: MaybeWrapped_open0_int_close0", diff --git a/bindgen-tests/tests/expectations/tests/typedef-pointer-overlap.rs b/bindgen-tests/tests/expectations/tests/typedef-pointer-overlap.rs index e25c19394e..f2376ed227 100644 --- a/bindgen-tests/tests/expectations/tests/typedef-pointer-overlap.rs +++ b/bindgen-tests/tests/expectations/tests/typedef-pointer-overlap.rs @@ -4,6 +4,7 @@ pub struct foo { pub inner: ::std::os::raw::c_char, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 1usize]; ["Alignment of foo"][::std::mem::align_of::() - 1usize]; @@ -15,6 +16,7 @@ pub type foo_ptr = *const foo; pub struct bar { pub inner: ::std::os::raw::c_char, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar"][::std::mem::size_of::() - 1usize]; ["Alignment of bar"][::std::mem::align_of::() - 1usize]; @@ -32,6 +34,7 @@ pub type baz_ptr = *mut baz; pub union cat { pub standard_issue: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of cat"][::std::mem::size_of::() - 4usize]; ["Alignment of cat"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/typeref.rs b/bindgen-tests/tests/expectations/tests/typeref.rs index 3ef184578d..e48f0eb254 100644 --- a/bindgen-tests/tests/expectations/tests/typeref.rs +++ b/bindgen-tests/tests/expectations/tests/typeref.rs @@ -4,6 +4,7 @@ pub struct mozilla_FragmentOrURL { pub mIsLocalRef: bool, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of mozilla_FragmentOrURL", @@ -20,6 +21,7 @@ const _: () = { pub struct mozilla_Position { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of mozilla_Position"][::std::mem::size_of::() - 1usize]; [ @@ -58,6 +60,7 @@ impl Default for mozilla_StyleShapeSource { pub struct Bar { pub mFoo: *mut nsFoo, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 8usize]; ["Alignment of Bar"][::std::mem::align_of::() - 8usize]; @@ -76,6 +79,7 @@ impl Default for Bar { pub struct nsFoo { pub mBar: mozilla_StyleShapeSource, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of nsFoo"][::std::mem::size_of::() - 8usize]; ["Alignment of nsFoo"][::std::mem::align_of::() - 8usize]; @@ -90,6 +94,7 @@ impl Default for nsFoo { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of template specialization: mozilla_StyleShapeSource_open0_int_close0", diff --git a/bindgen-tests/tests/expectations/tests/underscore.rs b/bindgen-tests/tests/expectations/tests/underscore.rs index 65482d7b14..f94d5fc580 100644 --- a/bindgen-tests/tests/expectations/tests/underscore.rs +++ b/bindgen-tests/tests/expectations/tests/underscore.rs @@ -5,6 +5,7 @@ pub const __: ::std::os::raw::c_int = 10; pub struct ptr_t { pub __: [::std::os::raw::c_uchar; 8usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ptr_t"][::std::mem::size_of::() - 8usize]; ["Alignment of ptr_t"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/union-in-ns.rs b/bindgen-tests/tests/expectations/tests/union-in-ns.rs index e1925d82cc..781041addb 100644 --- a/bindgen-tests/tests/expectations/tests/union-in-ns.rs +++ b/bindgen-tests/tests/expectations/tests/union-in-ns.rs @@ -8,6 +8,7 @@ pub mod root { pub union bar { pub baz: ::std::os::raw::c_int, } + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of bar"][::std::mem::size_of::() - 4usize]; ["Alignment of bar"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_bitfield.rs b/bindgen-tests/tests/expectations/tests/union_bitfield.rs index fea7dd00d9..b529dcfbc8 100644 --- a/bindgen-tests/tests/expectations/tests/union_bitfield.rs +++ b/bindgen-tests/tests/expectations/tests/union_bitfield.rs @@ -90,6 +90,7 @@ pub union U4 { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of U4"][::std::mem::size_of::() - 4usize]; ["Alignment of U4"][::std::mem::align_of::() - 4usize]; @@ -138,6 +139,7 @@ pub union B { pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of B"][::std::mem::size_of::() - 4usize]; ["Alignment of B"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_dtor.rs b/bindgen-tests/tests/expectations/tests/union_dtor.rs index 9f12f8e84f..168b0a0b1e 100644 --- a/bindgen-tests/tests/expectations/tests/union_dtor.rs +++ b/bindgen-tests/tests/expectations/tests/union_dtor.rs @@ -4,6 +4,7 @@ pub union UnionWithDtor { pub mFoo: ::std::os::raw::c_int, pub mBar: *mut ::std::os::raw::c_void, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of UnionWithDtor"][::std::mem::size_of::() - 8usize]; ["Alignment of UnionWithDtor"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_fields.rs b/bindgen-tests/tests/expectations/tests/union_fields.rs index cc68bce506..c3d0f8db61 100644 --- a/bindgen-tests/tests/expectations/tests/union_fields.rs +++ b/bindgen-tests/tests/expectations/tests/union_fields.rs @@ -6,6 +6,7 @@ pub union nsStyleUnion { pub mFloat: f32, pub mPointer: *mut ::std::os::raw::c_void, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of nsStyleUnion"][::std::mem::size_of::() - 8usize]; ["Alignment of nsStyleUnion"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_with_anon_struct.rs b/bindgen-tests/tests/expectations/tests/union_with_anon_struct.rs index c01c6d516b..20f4dd2265 100644 --- a/bindgen-tests/tests/expectations/tests/union_with_anon_struct.rs +++ b/bindgen-tests/tests/expectations/tests/union_with_anon_struct.rs @@ -10,6 +10,7 @@ pub struct foo__bindgen_ty_1 { pub a: ::std::os::raw::c_uint, pub b: ::std::os::raw::c_uint, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; [ @@ -22,6 +23,7 @@ const _: () = { "Offset of field: foo__bindgen_ty_1::b", ][::std::mem::offset_of!(foo__bindgen_ty_1, b) - 4usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 8usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_with_anon_struct_bitfield.rs b/bindgen-tests/tests/expectations/tests/union_with_anon_struct_bitfield.rs index 737ec715d3..f850f6a3da 100644 --- a/bindgen-tests/tests/expectations/tests/union_with_anon_struct_bitfield.rs +++ b/bindgen-tests/tests/expectations/tests/union_with_anon_struct_bitfield.rs @@ -95,6 +95,7 @@ pub struct foo__bindgen_ty_1 { pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; [ @@ -151,6 +152,7 @@ impl foo__bindgen_ty_1 { __bindgen_bitfield_unit } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_with_anon_union.rs b/bindgen-tests/tests/expectations/tests/union_with_anon_union.rs index f32fe6973f..212a159cd2 100644 --- a/bindgen-tests/tests/expectations/tests/union_with_anon_union.rs +++ b/bindgen-tests/tests/expectations/tests/union_with_anon_union.rs @@ -10,6 +10,7 @@ pub union foo__bindgen_ty_1 { pub a: ::std::os::raw::c_uint, pub b: ::std::os::raw::c_ushort, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; [ @@ -31,6 +32,7 @@ impl Default for foo__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_with_anon_unnamed_struct.rs b/bindgen-tests/tests/expectations/tests/union_with_anon_unnamed_struct.rs index 7579dd1dcf..859188e891 100644 --- a/bindgen-tests/tests/expectations/tests/union_with_anon_unnamed_struct.rs +++ b/bindgen-tests/tests/expectations/tests/union_with_anon_unnamed_struct.rs @@ -13,6 +13,7 @@ pub struct pixel__bindgen_ty_1 { pub b: ::std::os::raw::c_uchar, pub a: ::std::os::raw::c_uchar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of pixel__bindgen_ty_1", @@ -33,6 +34,7 @@ const _: () = { "Offset of field: pixel__bindgen_ty_1::a", ][::std::mem::offset_of!(pixel__bindgen_ty_1, a) - 3usize]; }; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of pixel"][::std::mem::size_of::() - 4usize]; ["Alignment of pixel"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_with_anon_unnamed_union.rs b/bindgen-tests/tests/expectations/tests/union_with_anon_unnamed_union.rs index bd24400324..6e136c0d92 100644 --- a/bindgen-tests/tests/expectations/tests/union_with_anon_unnamed_union.rs +++ b/bindgen-tests/tests/expectations/tests/union_with_anon_unnamed_union.rs @@ -11,6 +11,7 @@ pub union foo__bindgen_ty_1 { pub b: ::std::os::raw::c_ushort, pub c: ::std::os::raw::c_uchar, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 2usize]; [ @@ -32,6 +33,7 @@ impl Default for foo__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_with_big_member.rs b/bindgen-tests/tests/expectations/tests/union_with_big_member.rs index b6b2bc25d7..9d69957a85 100644 --- a/bindgen-tests/tests/expectations/tests/union_with_big_member.rs +++ b/bindgen-tests/tests/expectations/tests/union_with_big_member.rs @@ -5,6 +5,7 @@ pub union WithBigArray { pub a: ::std::os::raw::c_int, pub b: [::std::os::raw::c_int; 33usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of WithBigArray"][::std::mem::size_of::() - 132usize]; ["Alignment of WithBigArray"][::std::mem::align_of::() - 4usize]; @@ -30,6 +31,7 @@ pub union WithBigArray2 { pub a: ::std::os::raw::c_int, pub b: [::std::os::raw::c_char; 33usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of WithBigArray2"][::std::mem::size_of::() - 36usize]; ["Alignment of WithBigArray2"][::std::mem::align_of::() - 4usize]; @@ -55,6 +57,7 @@ pub union WithBigMember { pub a: ::std::os::raw::c_int, pub b: WithBigArray, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of WithBigMember"][::std::mem::size_of::() - 132usize]; ["Alignment of WithBigMember"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_with_nesting.rs b/bindgen-tests/tests/expectations/tests/union_with_nesting.rs index 774a410231..5b60193ba4 100644 --- a/bindgen-tests/tests/expectations/tests/union_with_nesting.rs +++ b/bindgen-tests/tests/expectations/tests/union_with_nesting.rs @@ -17,6 +17,7 @@ pub union foo__bindgen_ty_1__bindgen_ty_1 { pub b1: ::std::os::raw::c_ushort, pub b2: ::std::os::raw::c_ushort, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of foo__bindgen_ty_1__bindgen_ty_1", @@ -46,6 +47,7 @@ pub union foo__bindgen_ty_1__bindgen_ty_2 { pub c1: ::std::os::raw::c_ushort, pub c2: ::std::os::raw::c_ushort, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of foo__bindgen_ty_1__bindgen_ty_2", @@ -69,6 +71,7 @@ impl Default for foo__bindgen_ty_1__bindgen_ty_2 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; [ @@ -84,6 +87,7 @@ impl Default for foo__bindgen_ty_1 { } } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 4usize]; ["Alignment of foo"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/union_with_non_copy_member.rs b/bindgen-tests/tests/expectations/tests/union_with_non_copy_member.rs index fb00e14d4a..d13c24d2d8 100644 --- a/bindgen-tests/tests/expectations/tests/union_with_non_copy_member.rs +++ b/bindgen-tests/tests/expectations/tests/union_with_non_copy_member.rs @@ -47,6 +47,7 @@ impl ::std::cmp::Eq for __BindgenUnionField {} pub struct NonCopyType { pub foo: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of NonCopyType"][::std::mem::size_of::() - 4usize]; ["Alignment of NonCopyType"][::std::mem::align_of::() - 4usize]; @@ -60,6 +61,7 @@ pub struct WithBindgenGeneratedWrapper { pub bar: __BindgenUnionField<::std::os::raw::c_int>, pub bindgen_union_field: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of WithBindgenGeneratedWrapper", @@ -88,6 +90,7 @@ pub union WithManuallyDrop { pub non_copy_type: ::std::mem::ManuallyDrop, pub bar: ::std::mem::ManuallyDrop<::std::os::raw::c_int>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of WithManuallyDrop"][::std::mem::size_of::() - 4usize]; [ @@ -115,6 +118,7 @@ pub struct WithDefaultWrapper { pub bar: __BindgenUnionField<::std::os::raw::c_int>, pub bindgen_union_field: u32, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of WithDefaultWrapper"][::std::mem::size_of::() - 4usize]; [ diff --git a/bindgen-tests/tests/expectations/tests/unknown_attr.rs b/bindgen-tests/tests/expectations/tests/unknown_attr.rs index 58c64f7fdb..bdfebb29dc 100644 --- a/bindgen-tests/tests/expectations/tests/unknown_attr.rs +++ b/bindgen-tests/tests/expectations/tests/unknown_attr.rs @@ -7,6 +7,7 @@ pub struct max_align_t { pub __bindgen_padding_0: u64, pub __clang_max_align_nonce2: ::std::os::raw::c_longlong, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of max_align_t"][::std::mem::size_of::() - 32usize]; ["Alignment of max_align_t"][::std::mem::align_of::() - 16usize]; diff --git a/bindgen-tests/tests/expectations/tests/unsorted-items.rs b/bindgen-tests/tests/expectations/tests/unsorted-items.rs index c73ae5124c..fca5715533 100644 --- a/bindgen-tests/tests/expectations/tests/unsorted-items.rs +++ b/bindgen-tests/tests/expectations/tests/unsorted-items.rs @@ -12,6 +12,7 @@ pub struct Point { pub x: number, pub y: number, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Point"][::std::mem::size_of::() - 8usize]; ["Alignment of Point"][::std::mem::align_of::() - 4usize]; @@ -24,6 +25,7 @@ pub struct Angle { pub a: number, pub b: number, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Angle"][::std::mem::size_of::() - 8usize]; ["Alignment of Angle"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/use-core.rs b/bindgen-tests/tests/expectations/tests/use-core.rs index 20272bc5fb..e7b3ce8982 100644 --- a/bindgen-tests/tests/expectations/tests/use-core.rs +++ b/bindgen-tests/tests/expectations/tests/use-core.rs @@ -8,6 +8,7 @@ pub struct foo { pub b: ::core::ffi::c_int, pub bar: *mut ::core::ffi::c_void, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::core::mem::size_of::() - 16usize]; ["Alignment of foo"][::core::mem::align_of::() - 8usize]; @@ -30,6 +31,7 @@ pub union _bindgen_ty_1 { pub bar: ::core::ffi::c_int, pub baz: ::core::ffi::c_long, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _bindgen_ty_1"][::core::mem::size_of::<_bindgen_ty_1>() - 8usize]; ["Alignment of _bindgen_ty_1"][::core::mem::align_of::<_bindgen_ty_1>() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/var-tracing.rs b/bindgen-tests/tests/expectations/tests/var-tracing.rs index 8c61ee9d39..606cdd70b8 100644 --- a/bindgen-tests/tests/expectations/tests/var-tracing.rs +++ b/bindgen-tests/tests/expectations/tests/var-tracing.rs @@ -4,6 +4,7 @@ pub struct Bar { pub m_baz: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 4usize]; ["Alignment of Bar"][::std::mem::align_of::() - 4usize]; @@ -30,6 +31,7 @@ extern "C" { #[link_name = "\u{1}_ZN3Baz3FOOE"] pub static Baz_FOO: [Bar; 0usize]; } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Baz"][::std::mem::size_of::() - 1usize]; ["Alignment of Baz"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/variadic-method.rs b/bindgen-tests/tests/expectations/tests/variadic-method.rs index 8abf4343cf..93ce01b813 100644 --- a/bindgen-tests/tests/expectations/tests/variadic-method.rs +++ b/bindgen-tests/tests/expectations/tests/variadic-method.rs @@ -8,6 +8,7 @@ extern "C" { pub struct Bar { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Bar"][::std::mem::size_of::() - 1usize]; ["Alignment of Bar"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/vector.rs b/bindgen-tests/tests/expectations/tests/vector.rs index d4aed8a235..2278b520d9 100644 --- a/bindgen-tests/tests/expectations/tests/vector.rs +++ b/bindgen-tests/tests/expectations/tests/vector.rs @@ -4,6 +4,7 @@ pub struct foo { pub mMember: [::std::os::raw::c_longlong; 1usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of foo"][::std::mem::size_of::() - 8usize]; ["Alignment of foo"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/virtual_dtor.rs b/bindgen-tests/tests/expectations/tests/virtual_dtor.rs index 26198a1b4d..84211429b1 100644 --- a/bindgen-tests/tests/expectations/tests/virtual_dtor.rs +++ b/bindgen-tests/tests/expectations/tests/virtual_dtor.rs @@ -6,6 +6,7 @@ pub struct nsSlots__bindgen_vtable(::std::os::raw::c_void); pub struct nsSlots { pub vtable_: *const nsSlots__bindgen_vtable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of nsSlots"][::std::mem::size_of::() - 8usize]; ["Alignment of nsSlots"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/virtual_interface.rs b/bindgen-tests/tests/expectations/tests/virtual_interface.rs index ef46cbe6c4..44b245c4ea 100644 --- a/bindgen-tests/tests/expectations/tests/virtual_interface.rs +++ b/bindgen-tests/tests/expectations/tests/virtual_interface.rs @@ -12,6 +12,7 @@ pub struct PureVirtualIFace__bindgen_vtable { pub struct PureVirtualIFace { pub vtable_: *const PureVirtualIFace__bindgen_vtable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PureVirtualIFace"][::std::mem::size_of::() - 8usize]; [ @@ -36,6 +37,7 @@ pub struct AnotherInterface__bindgen_vtable { pub struct AnotherInterface { pub vtable_: *const AnotherInterface__bindgen_vtable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of AnotherInterface"][::std::mem::size_of::() - 8usize]; [ @@ -56,6 +58,7 @@ impl Default for AnotherInterface { pub struct Implementation { pub _base: PureVirtualIFace, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Implementation"][::std::mem::size_of::() - 8usize]; ["Alignment of Implementation"][::std::mem::align_of::() - 8usize]; @@ -75,6 +78,7 @@ pub struct DoubleImpl { pub _base: PureVirtualIFace, pub _base_1: AnotherInterface, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of DoubleImpl"][::std::mem::size_of::() - 16usize]; ["Alignment of DoubleImpl"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/virtual_overloaded.rs b/bindgen-tests/tests/expectations/tests/virtual_overloaded.rs index ab2df5f191..800ebbef8f 100644 --- a/bindgen-tests/tests/expectations/tests/virtual_overloaded.rs +++ b/bindgen-tests/tests/expectations/tests/virtual_overloaded.rs @@ -9,6 +9,7 @@ pub struct C__bindgen_vtable { pub struct C { pub vtable_: *const C__bindgen_vtable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of C"][::std::mem::size_of::() - 8usize]; ["Alignment of C"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/vtable_recursive_sig.rs b/bindgen-tests/tests/expectations/tests/vtable_recursive_sig.rs index 78b240ba09..fe08228ab9 100644 --- a/bindgen-tests/tests/expectations/tests/vtable_recursive_sig.rs +++ b/bindgen-tests/tests/expectations/tests/vtable_recursive_sig.rs @@ -8,6 +8,7 @@ pub struct Base__bindgen_vtable { pub struct Base { pub vtable_: *const Base__bindgen_vtable, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Base"][::std::mem::size_of::() - 8usize]; ["Alignment of Base"][::std::mem::align_of::() - 8usize]; @@ -30,6 +31,7 @@ extern "C" { pub struct Derived { pub _base: Base, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Derived"][::std::mem::size_of::() - 8usize]; ["Alignment of Derived"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/wasm-constructor-returns.rs b/bindgen-tests/tests/expectations/tests/wasm-constructor-returns.rs index 00db5776c6..092d592e29 100644 --- a/bindgen-tests/tests/expectations/tests/wasm-constructor-returns.rs +++ b/bindgen-tests/tests/expectations/tests/wasm-constructor-returns.rs @@ -4,6 +4,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/weird_bitfields.rs b/bindgen-tests/tests/expectations/tests/weird_bitfields.rs index c6ab6fb7c4..f76189eb74 100644 --- a/bindgen-tests/tests/expectations/tests/weird_bitfields.rs +++ b/bindgen-tests/tests/expectations/tests/weird_bitfields.rs @@ -111,6 +111,7 @@ pub struct Weird { pub _bitfield_2: __BindgenBitfieldUnit<[u8; 2usize]>, pub __bindgen_padding_0: [u8; 3usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Weird"][::std::mem::size_of::() - 24usize]; ["Alignment of Weird"][::std::mem::align_of::() - 4usize]; diff --git a/bindgen-tests/tests/expectations/tests/what_is_going_on.rs b/bindgen-tests/tests/expectations/tests/what_is_going_on.rs index bfc26f3950..aaeab668e1 100644 --- a/bindgen-tests/tests/expectations/tests/what_is_going_on.rs +++ b/bindgen-tests/tests/expectations/tests/what_is_going_on.rs @@ -4,6 +4,7 @@ pub struct UnknownUnits { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of UnknownUnits"][::std::mem::size_of::() - 1usize]; ["Alignment of UnknownUnits"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/win32-thiscall_nightly.rs b/bindgen-tests/tests/expectations/tests/win32-thiscall_nightly.rs index 187fa75ee4..3c84de7b95 100644 --- a/bindgen-tests/tests/expectations/tests/win32-thiscall_nightly.rs +++ b/bindgen-tests/tests/expectations/tests/win32-thiscall_nightly.rs @@ -6,6 +6,7 @@ pub struct Foo { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of Foo"][::std::mem::size_of::() - 1usize]; ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; diff --git a/bindgen-tests/tests/expectations/tests/zero-size-array-align.rs b/bindgen-tests/tests/expectations/tests/zero-size-array-align.rs index f1e18874a4..48fc0cb1d6 100644 --- a/bindgen-tests/tests/expectations/tests/zero-size-array-align.rs +++ b/bindgen-tests/tests/expectations/tests/zero-size-array-align.rs @@ -36,6 +36,7 @@ pub struct dm_deps { pub filler: ::std::os::raw::c_uint, pub device: __IncompleteArrayField<::std::os::raw::c_ulonglong>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of dm_deps"][::std::mem::size_of::() - 8usize]; ["Alignment of dm_deps"][::std::mem::align_of::() - 8usize]; diff --git a/bindgen-tests/tests/expectations/tests/zero-sized-array.rs b/bindgen-tests/tests/expectations/tests/zero-sized-array.rs index ba8310b747..229a6ee4db 100644 --- a/bindgen-tests/tests/expectations/tests/zero-sized-array.rs +++ b/bindgen-tests/tests/expectations/tests/zero-sized-array.rs @@ -35,6 +35,7 @@ impl ::std::fmt::Debug for __IncompleteArrayField { pub struct ZeroSizedArray { pub arr: __IncompleteArrayField<::std::os::raw::c_char>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of ZeroSizedArray"][::std::mem::size_of::() - 0usize]; ["Alignment of ZeroSizedArray"][::std::mem::align_of::() - 1usize]; @@ -48,6 +49,7 @@ const _: () = { pub struct ContainsZeroSizedArray { pub zsa: ZeroSizedArray, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ContainsZeroSizedArray", @@ -66,6 +68,7 @@ const _: () = { pub struct InheritsZeroSizedArray { pub _base: ZeroSizedArray, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of InheritsZeroSizedArray", @@ -80,6 +83,7 @@ const _: () = { pub struct DynamicallySizedArray { pub arr: __IncompleteArrayField<::std::os::raw::c_char>, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of DynamicallySizedArray", @@ -97,6 +101,7 @@ const _: () = { pub struct ContainsDynamicallySizedArray { pub dsa: DynamicallySizedArray, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [ "Size of ContainsDynamicallySizedArray", diff --git a/bindgen/codegen/mod.rs b/bindgen/codegen/mod.rs index 46d615b25d..741a3fbe43 100644 --- a/bindgen/codegen/mod.rs +++ b/bindgen/codegen/mod.rs @@ -1313,6 +1313,7 @@ impl CodeGenerator for TemplateInstantiation { // #size_of_expr < #size, the subtraction will overflow, both // of which print enough information to see what has gone wrong. result.push(quote! { + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [#size_of_err][#size_of_expr - #size]; [#align_of_err][#align_of_expr - #align]; @@ -2523,6 +2524,7 @@ impl CodeGenerator for CompInfo { if compile_time { result.push(quote! { + #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { [#size_of_err][#size_of_expr - #size]; #check_struct_align