codegen: Bump minimum stable target.

Supporting const generics significantly simplifies some upcoming
correctness fixes, and rust 1.51 is more than four years old at this
point.

This highlighted some issues with some of the features that we've
implemented since (e.g. the code to generate partialeq was broken in a
lot of cases).
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c0d3494..74ff973 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -229,6 +229,7 @@
 ## Added
 ## Changed
 ## Removed
+- Removed support for generating code for rustc versions < 1.51.
 ## Fixed
 - Typo in code for `--rustified-non-exhaustive-enums` (#3266)
 ## Security
diff --git a/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result.rs b/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result.rs
index 07eb7a8..ec152e1 100644
--- a/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result.rs
+++ b/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result.rs
@@ -4,12 +4,12 @@
 pub struct Foo {
     pub _address: u8,
 }
-#[test]
-fn bindgen_test_layout_Foo() {
-    assert_eq!(::std::mem::size_of::<Foo>(), 1usize, "Size of Foo");
-    assert_eq!(::std::mem::align_of::<Foo>(), 1usize, "Alignment of Foo");
-}
-extern "C" {
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Foo"][::std::mem::size_of::<Foo>() - 1usize];
+    ["Alignment of Foo"][::std::mem::align_of::<Foo>() - 1usize];
+};
+unsafe extern "C" {
     #[must_use]
     #[link_name = "\u{1}_ZN3Foo3fooEi"]
     pub fn Foo_foo(this: *mut Foo, arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
@@ -21,7 +21,7 @@
         Foo_foo(self, arg1)
     }
 }
-extern "C" {
+unsafe extern "C" {
     #[must_use]
     #[link_name = "\u{1}_Z3fooi"]
     pub fn foo(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
diff --git a/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs b/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs
index aa01540..f0fb434 100644
--- a/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs
+++ b/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs
@@ -4,12 +4,12 @@
 pub struct Foo {
     pub _address: u8,
 }
-#[test]
-fn bindgen_test_layout_Foo() {
-    assert_eq!(::std::mem::size_of::<Foo>(), 1usize, "Size of Foo");
-    assert_eq!(::std::mem::align_of::<Foo>(), 1usize, "Alignment of Foo");
-}
-extern "C" {
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Foo"][::std::mem::size_of::<Foo>() - 1usize];
+    ["Alignment of Foo"][::std::mem::align_of::<Foo>() - 1usize];
+};
+unsafe extern "C" {
     #[link_name = "\u{1}_ZN3Foo3fooEi"]
     pub fn Foo_foo(this: *mut Foo, arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
 }
@@ -19,7 +19,7 @@
         Foo_foo(self, arg1)
     }
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}_Z3fooi"]
     pub fn foo(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
 }
diff --git a/bindgen-tests/tests/expectations/tests/bindgen-union-inside-namespace.rs b/bindgen-tests/tests/expectations/tests/bindgen-union-inside-namespace.rs
index f3d7893..2c8d2e5 100644
--- a/bindgen-tests/tests/expectations/tests/bindgen-union-inside-namespace.rs
+++ b/bindgen-tests/tests/expectations/tests/bindgen-union-inside-namespace.rs
@@ -12,29 +12,19 @@
             pub foo: ::std::os::raw::c_int,
             pub bar: ::std::os::raw::c_int,
         }
-        #[test]
-        fn bindgen_test_layout_Bar() {
-            const UNINIT: ::std::mem::MaybeUninit<Bar> = ::std::mem::MaybeUninit::uninit();
-            let ptr = UNINIT.as_ptr();
-            assert_eq!(::std::mem::size_of::<Bar>(), 4usize, "Size of Bar");
-            assert_eq!(::std::mem::align_of::<Bar>(), 4usize, "Alignment of Bar");
-            assert_eq!(
-                unsafe { ::std::ptr::addr_of!((*ptr).foo) as usize - ptr as usize },
-                0usize,
-                "Offset of field: Bar::foo",
-            );
-            assert_eq!(
-                unsafe { ::std::ptr::addr_of!((*ptr).bar) as usize - ptr as usize },
-                0usize,
-                "Offset of field: Bar::bar",
-            );
-        }
+        #[allow(clippy::unnecessary_operation, clippy::identity_op)]
+        const _: () = {
+            ["Size of Bar"][::std::mem::size_of::<Bar>() - 4usize];
+            ["Alignment of Bar"][::std::mem::align_of::<Bar>() - 4usize];
+            ["Offset of field: Bar::foo"][::std::mem::offset_of!(Bar, foo) - 0usize];
+            ["Offset of field: Bar::bar"][::std::mem::offset_of!(Bar, bar) - 0usize];
+        };
         impl Default for Bar {
             fn default() -> Self {
+                let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
                 unsafe {
-                    let mut s: Self = ::std::mem::uninitialized();
-                    ::std::ptr::write_bytes(&mut s, 0, 1);
-                    s
+                    ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+                    s.assume_init()
                 }
             }
         }
diff --git a/bindgen-tests/tests/expectations/tests/class.rs b/bindgen-tests/tests/expectations/tests/class.rs
index 69591d1..98ee43b 100644
--- a/bindgen-tests/tests/expectations/tests/class.rs
+++ b/bindgen-tests/tests/expectations/tests/class.rs
@@ -30,28 +30,18 @@
     }
 }
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
 pub struct C {
     pub a: ::std::os::raw::c_int,
     pub big_array: [::std::os::raw::c_char; 33usize],
 }
-#[test]
-fn bindgen_test_layout_C() {
-    const UNINIT: ::std::mem::MaybeUninit<C> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<C>(), 40usize, "Size of C");
-    assert_eq!(::std::mem::align_of::<C>(), 4usize, "Alignment of C");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        "Offset of field: C::a",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
-        "Offset of field: C::big_array",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of C"][::std::mem::size_of::<C>() - 40usize];
+    ["Alignment of C"][::std::mem::align_of::<C>() - 4usize];
+    ["Offset of field: C::a"][::std::mem::offset_of!(C, a) - 0usize];
+    ["Offset of field: C::big_array"][::std::mem::offset_of!(C, big_array) - 4usize];
+};
 impl Default for C {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -62,43 +52,30 @@
     }
 }
 #[repr(C)]
+#[derive(Debug)]
 pub struct C_with_zero_length_array {
     pub a: ::std::os::raw::c_int,
     pub big_array: [::std::os::raw::c_char; 33usize],
     pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
 }
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_zero_length_array> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array>(),
-        40usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of C_with_zero_length_array",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array>(),
-        4usize,
+    ][::std::mem::size_of::<C_with_zero_length_array>() - 40usize];
+    [
         "Alignment of C_with_zero_length_array",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<C_with_zero_length_array>() - 4usize];
+    [
         "Offset of field: C_with_zero_length_array::a",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(C_with_zero_length_array, a) - 0usize];
+    [
         "Offset of field: C_with_zero_length_array::big_array",
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        37usize,
+    ][::std::mem::offset_of!(C_with_zero_length_array, big_array) - 4usize];
+    [
         "Offset of field: C_with_zero_length_array::zero_length_array",
-    );
-}
+    ][::std::mem::offset_of!(C_with_zero_length_array, zero_length_array) - 37usize];
+};
 impl Default for C_with_zero_length_array {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -114,69 +91,46 @@
     pub a: ::std::os::raw::c_int,
     pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
 }
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array_2() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_zero_length_array_2> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array_2>(),
-        4usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of C_with_zero_length_array_2",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array_2>(),
-        4usize,
+    ][::std::mem::size_of::<C_with_zero_length_array_2>() - 4usize];
+    [
         "Alignment of C_with_zero_length_array_2",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<C_with_zero_length_array_2>() - 4usize];
+    [
         "Offset of field: C_with_zero_length_array_2::a",
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        4usize,
+    ][::std::mem::offset_of!(C_with_zero_length_array_2, a) - 0usize];
+    [
         "Offset of field: C_with_zero_length_array_2::zero_length_array",
-    );
-}
+    ][::std::mem::offset_of!(C_with_zero_length_array_2, zero_length_array) - 4usize];
+};
 #[repr(C)]
+#[derive(Debug)]
 pub struct C_with_incomplete_array {
     pub a: ::std::os::raw::c_int,
     pub big_array: [::std::os::raw::c_char; 33usize],
     pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
 }
-#[test]
-fn bindgen_test_layout_C_with_incomplete_array() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_incomplete_array> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_incomplete_array>(),
-        40usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of C_with_incomplete_array",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_incomplete_array>(),
-        4usize,
+    ][::std::mem::size_of::<C_with_incomplete_array>() - 40usize];
+    [
         "Alignment of C_with_incomplete_array",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<C_with_incomplete_array>() - 4usize];
+    [
         "Offset of field: C_with_incomplete_array::a",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(C_with_incomplete_array, a) - 0usize];
+    [
         "Offset of field: C_with_incomplete_array::big_array",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        37usize,
+    ][::std::mem::offset_of!(C_with_incomplete_array, big_array) - 4usize];
+    [
         "Offset of field: C_with_incomplete_array::incomplete_array",
-    );
-}
+    ][::std::mem::offset_of!(C_with_incomplete_array, incomplete_array) - 37usize];
+};
 impl Default for C_with_incomplete_array {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -192,77 +146,55 @@
     pub a: ::std::os::raw::c_int,
     pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
 }
-#[test]
-fn bindgen_test_layout_C_with_incomplete_array_2() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_incomplete_array_2> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_incomplete_array_2>(),
-        4usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of C_with_incomplete_array_2",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_incomplete_array_2>(),
-        4usize,
+    ][::std::mem::size_of::<C_with_incomplete_array_2>() - 4usize];
+    [
         "Alignment of C_with_incomplete_array_2",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<C_with_incomplete_array_2>() - 4usize];
+    [
         "Offset of field: C_with_incomplete_array_2::a",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(C_with_incomplete_array_2, a) - 0usize];
+    [
         "Offset of field: C_with_incomplete_array_2::incomplete_array",
-    );
-}
+    ][::std::mem::offset_of!(C_with_incomplete_array_2, incomplete_array) - 4usize];
+};
 #[repr(C)]
+#[derive(Debug)]
 pub struct C_with_zero_length_array_and_incomplete_array {
     pub a: ::std::os::raw::c_int,
     pub big_array: [::std::os::raw::c_char; 33usize],
     pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
     pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
 }
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
-    const UNINIT: ::std::mem::MaybeUninit<
-        C_with_zero_length_array_and_incomplete_array,
-    > = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array>(),
-        40usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of C_with_zero_length_array_and_incomplete_array",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array>(),
-        4usize,
+    ][::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array>() - 40usize];
+    [
         "Alignment of C_with_zero_length_array_and_incomplete_array",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array>() - 4usize];
+    [
         "Offset of field: C_with_zero_length_array_and_incomplete_array::a",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(C_with_zero_length_array_and_incomplete_array, a) - 0usize];
+    [
         "Offset of field: C_with_zero_length_array_and_incomplete_array::big_array",
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        37usize,
+    ][::std::mem::offset_of!(C_with_zero_length_array_and_incomplete_array, big_array)
+        - 4usize];
+    [
         "Offset of field: C_with_zero_length_array_and_incomplete_array::zero_length_array",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        37usize,
+    ][::std::mem::offset_of!(
+        C_with_zero_length_array_and_incomplete_array, zero_length_array
+    ) - 37usize];
+    [
         "Offset of field: C_with_zero_length_array_and_incomplete_array::incomplete_array",
-    );
-}
+    ][::std::mem::offset_of!(
+        C_with_zero_length_array_and_incomplete_array, incomplete_array
+    ) - 37usize];
+};
 impl Default for C_with_zero_length_array_and_incomplete_array {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -279,87 +211,62 @@
     pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
     pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
 }
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() {
-    const UNINIT: ::std::mem::MaybeUninit<
-        C_with_zero_length_array_and_incomplete_array_2,
-    > = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array_2>(),
-        4usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of C_with_zero_length_array_and_incomplete_array_2",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array_2>(),
-        4usize,
+    ][::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array_2>() - 4usize];
+    [
         "Alignment of C_with_zero_length_array_and_incomplete_array_2",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array_2>()
+        - 4usize];
+    [
         "Offset of field: C_with_zero_length_array_and_incomplete_array_2::a",
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        4usize,
+    ][::std::mem::offset_of!(C_with_zero_length_array_and_incomplete_array_2, a)
+        - 0usize];
+    [
         "Offset of field: C_with_zero_length_array_and_incomplete_array_2::zero_length_array",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(
+        C_with_zero_length_array_and_incomplete_array_2, zero_length_array
+    ) - 4usize];
+    [
         "Offset of field: C_with_zero_length_array_and_incomplete_array_2::incomplete_array",
-    );
-}
+    ][::std::mem::offset_of!(
+        C_with_zero_length_array_and_incomplete_array_2, incomplete_array
+    ) - 4usize];
+};
 #[repr(C)]
 #[derive(Debug, Default, Hash, PartialOrd, Ord, PartialEq, Eq)]
 pub struct WithDtor {
     pub b: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_WithDtor() {
-    const UNINIT: ::std::mem::MaybeUninit<WithDtor> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<WithDtor>(), 4usize, "Size of WithDtor");
-    assert_eq!(::std::mem::align_of::<WithDtor>(), 4usize, "Alignment of WithDtor");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize },
-        0usize,
-        "Offset of field: WithDtor::b",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of WithDtor"][::std::mem::size_of::<WithDtor>() - 4usize];
+    ["Alignment of WithDtor"][::std::mem::align_of::<WithDtor>() - 4usize];
+    ["Offset of field: WithDtor::b"][::std::mem::offset_of!(WithDtor, b) - 0usize];
+};
 #[repr(C)]
+#[derive(Debug)]
 pub struct IncompleteArrayNonCopiable {
     pub whatever: *mut ::std::os::raw::c_void,
     pub incomplete_array: __IncompleteArrayField<C>,
 }
-#[test]
-fn bindgen_test_layout_IncompleteArrayNonCopiable() {
-    const UNINIT: ::std::mem::MaybeUninit<IncompleteArrayNonCopiable> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<IncompleteArrayNonCopiable>(),
-        8usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of IncompleteArrayNonCopiable",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<IncompleteArrayNonCopiable>(),
-        8usize,
+    ][::std::mem::size_of::<IncompleteArrayNonCopiable>() - 8usize];
+    [
         "Alignment of IncompleteArrayNonCopiable",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).whatever) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<IncompleteArrayNonCopiable>() - 8usize];
+    [
         "Offset of field: IncompleteArrayNonCopiable::whatever",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(IncompleteArrayNonCopiable, whatever) - 0usize];
+    [
         "Offset of field: IncompleteArrayNonCopiable::incomplete_array",
-    );
-}
+    ][::std::mem::offset_of!(IncompleteArrayNonCopiable, incomplete_array) - 8usize];
+};
 impl Default for IncompleteArrayNonCopiable {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -375,23 +282,13 @@
     pub d: f32,
     pub i: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_Union() {
-    const UNINIT: ::std::mem::MaybeUninit<Union> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<Union>(), 4usize, "Size of Union");
-    assert_eq!(::std::mem::align_of::<Union>(), 4usize, "Alignment of Union");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize },
-        0usize,
-        "Offset of field: Union::d",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).i) as usize - ptr as usize },
-        0usize,
-        "Offset of field: Union::i",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Union"][::std::mem::size_of::<Union>() - 4usize];
+    ["Alignment of Union"][::std::mem::align_of::<Union>() - 4usize];
+    ["Offset of field: Union::d"][::std::mem::offset_of!(Union, d) - 0usize];
+    ["Offset of field: Union::i"][::std::mem::offset_of!(Union, i) - 0usize];
+};
 impl Default for Union {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -406,18 +303,14 @@
 pub struct WithUnion {
     pub data: Union,
 }
-#[test]
-fn bindgen_test_layout_WithUnion() {
-    const UNINIT: ::std::mem::MaybeUninit<WithUnion> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<WithUnion>(), 4usize, "Size of WithUnion");
-    assert_eq!(::std::mem::align_of::<WithUnion>(), 4usize, "Alignment of WithUnion");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of WithUnion"][::std::mem::size_of::<WithUnion>() - 4usize];
+    ["Alignment of WithUnion"][::std::mem::align_of::<WithUnion>() - 4usize];
+    [
         "Offset of field: WithUnion::data",
-    );
-}
+    ][::std::mem::offset_of!(WithUnion, data) - 0usize];
+};
 impl Default for WithUnion {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -432,39 +325,35 @@
 pub struct RealAbstractionWithTonsOfMethods {
     pub _address: u8,
 }
-#[test]
-fn bindgen_test_layout_RealAbstractionWithTonsOfMethods() {
-    assert_eq!(
-        ::std::mem::size_of::<RealAbstractionWithTonsOfMethods>(),
-        1usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of RealAbstractionWithTonsOfMethods",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<RealAbstractionWithTonsOfMethods>(),
-        1usize,
+    ][::std::mem::size_of::<RealAbstractionWithTonsOfMethods>() - 1usize];
+    [
         "Alignment of RealAbstractionWithTonsOfMethods",
-    );
-}
-extern "C" {
+    ][::std::mem::align_of::<RealAbstractionWithTonsOfMethods>() - 1usize];
+};
+unsafe extern "C" {
     #[link_name = "\u{1}_ZNK32RealAbstractionWithTonsOfMethods3barEv"]
     pub fn RealAbstractionWithTonsOfMethods_bar(
         this: *const RealAbstractionWithTonsOfMethods,
     );
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEv"]
     pub fn RealAbstractionWithTonsOfMethods_bar1(
         this: *mut RealAbstractionWithTonsOfMethods,
     );
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEi"]
     pub fn RealAbstractionWithTonsOfMethods_bar2(
         this: *mut RealAbstractionWithTonsOfMethods,
         foo: ::std::os::raw::c_int,
     );
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3staEv"]
     pub fn RealAbstractionWithTonsOfMethods_sta();
 }
diff --git a/bindgen-tests/tests/expectations/tests/constructors_1_33.rs b/bindgen-tests/tests/expectations/tests/constructors_1_33.rs
index 0563b4e..5dbda00 100644
--- a/bindgen-tests/tests/expectations/tests/constructors_1_33.rs
+++ b/bindgen-tests/tests/expectations/tests/constructors_1_33.rs
@@ -4,16 +4,12 @@
 pub struct TestOverload {
     pub _address: u8,
 }
-#[test]
-fn bindgen_test_layout_TestOverload() {
-    assert_eq!(::std::mem::size_of::<TestOverload>(), 1usize, "Size of TestOverload");
-    assert_eq!(
-        ::std::mem::align_of::<TestOverload>(),
-        1usize,
-        "Alignment of TestOverload",
-    );
-}
-extern "C" {
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of TestOverload"][::std::mem::size_of::<TestOverload>() - 1usize];
+    ["Alignment of TestOverload"][::std::mem::align_of::<TestOverload>() - 1usize];
+};
+unsafe extern "C" {
     /// Calling this should use `mem::unintialized()` and not `MaybeUninit()` as only rust 1.36 includes that.
     #[link_name = "\u{1}_ZN12TestOverloadC1Ei"]
     pub fn TestOverload_TestOverload(
@@ -21,7 +17,7 @@
         arg1: ::std::os::raw::c_int,
     );
 }
-extern "C" {
+unsafe extern "C" {
     /// Calling this should use `mem::unintialized()` and not `MaybeUninit()` as only rust 1.36 includes that.
     #[link_name = "\u{1}_ZN12TestOverloadC1Ed"]
     pub fn TestOverload_TestOverload1(this: *mut TestOverload, arg1: f64);
@@ -29,15 +25,15 @@
 impl TestOverload {
     #[inline]
     pub unsafe fn new(arg1: ::std::os::raw::c_int) -> Self {
-        let mut __bindgen_tmp = ::std::mem::uninitialized();
-        TestOverload_TestOverload(&mut __bindgen_tmp, arg1);
-        __bindgen_tmp
+        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
+        TestOverload_TestOverload(__bindgen_tmp.as_mut_ptr(), arg1);
+        __bindgen_tmp.assume_init()
     }
     #[inline]
     pub unsafe fn new1(arg1: f64) -> Self {
-        let mut __bindgen_tmp = ::std::mem::uninitialized();
-        TestOverload_TestOverload1(&mut __bindgen_tmp, arg1);
-        __bindgen_tmp
+        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
+        TestOverload_TestOverload1(__bindgen_tmp.as_mut_ptr(), arg1);
+        __bindgen_tmp.assume_init()
     }
 }
 #[repr(C)]
@@ -45,28 +41,22 @@
 pub struct TestPublicNoArgs {
     pub _address: u8,
 }
-#[test]
-fn bindgen_test_layout_TestPublicNoArgs() {
-    assert_eq!(
-        ::std::mem::size_of::<TestPublicNoArgs>(),
-        1usize,
-        "Size of TestPublicNoArgs",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<TestPublicNoArgs>(),
-        1usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of TestPublicNoArgs"][::std::mem::size_of::<TestPublicNoArgs>() - 1usize];
+    [
         "Alignment of TestPublicNoArgs",
-    );
-}
-extern "C" {
+    ][::std::mem::align_of::<TestPublicNoArgs>() - 1usize];
+};
+unsafe extern "C" {
     #[link_name = "\u{1}_ZN16TestPublicNoArgsC1Ev"]
     pub fn TestPublicNoArgs_TestPublicNoArgs(this: *mut TestPublicNoArgs);
 }
 impl TestPublicNoArgs {
     #[inline]
     pub unsafe fn new() -> Self {
-        let mut __bindgen_tmp = ::std::mem::uninitialized();
-        TestPublicNoArgs_TestPublicNoArgs(&mut __bindgen_tmp);
-        __bindgen_tmp
+        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
+        TestPublicNoArgs_TestPublicNoArgs(__bindgen_tmp.as_mut_ptr());
+        __bindgen_tmp.assume_init()
     }
 }
diff --git a/bindgen-tests/tests/expectations/tests/derive-bitfield-method-same-name.rs b/bindgen-tests/tests/expectations/tests/derive-bitfield-method-same-name.rs
index c2a9d33..7fa8bc4 100644
--- a/bindgen-tests/tests/expectations/tests/derive-bitfield-method-same-name.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-bitfield-method-same-name.rs
@@ -32,6 +32,16 @@
         Self::extract_bit(byte, index)
     }
     #[inline]
+    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+        let byte_index = index / 8;
+        let byte = unsafe {
+            *(core::ptr::addr_of!((*this).storage) as *const u8)
+                .offset(byte_index as isize)
+        };
+        Self::extract_bit(byte, index)
+    }
+    #[inline]
     fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
         let bit_index = if cfg!(target_endian = "big") {
             7 - (index % 8)
@@ -49,6 +59,16 @@
         *byte = Self::change_bit(*byte, index, val);
     }
     #[inline]
+    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+        let byte_index = index / 8;
+        let byte = unsafe {
+            (core::ptr::addr_of_mut!((*this).storage) as *mut u8)
+                .offset(byte_index as isize)
+        };
+        unsafe { *byte = Self::change_bit(*byte, index, val) };
+    }
+    #[inline]
     pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -69,6 +89,26 @@
         val
     }
     #[inline]
+    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),
+        );
+        let mut val = 0;
+        for i in 0..(bit_width as usize) {
+            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
+                let index = if cfg!(target_endian = "big") {
+                    bit_width as usize - 1 - i
+                } else {
+                    i
+                };
+                val |= 1 << index;
+            }
+        }
+        val
+    }
+    #[inline]
     pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -86,38 +126,50 @@
             self.set_bit(index + bit_offset, val_bit_is_set);
         }
     }
+    #[inline]
+    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),
+        );
+        for i in 0..(bit_width as usize) {
+            let mask = 1 << i;
+            let val_bit_is_set = val & mask == mask;
+            let index = if cfg!(target_endian = "big") {
+                bit_width as usize - 1 - i
+            } else {
+                i
+            };
+            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
+        }
+    }
 }
 /** Because this struct have array larger than 32 items
  and --with-derive-partialeq --impl-partialeq --impl-debug is provided,
  this struct should manually implement `Debug` and `PartialEq`.*/
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, PartialEq)]
 pub struct Foo {
     pub large: [::std::os::raw::c_int; 33usize],
     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
     pub __bindgen_padding_0: u16,
 }
-#[test]
-fn bindgen_test_layout_Foo() {
-    const UNINIT: ::std::mem::MaybeUninit<Foo> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<Foo>(), 136usize, "Size of Foo");
-    assert_eq!(::std::mem::align_of::<Foo>(), 4usize, "Alignment of Foo");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).large) as usize - ptr as usize },
-        0usize,
-        "Offset of field: Foo::large",
-    );
-}
-extern "C" {
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Foo"][::std::mem::size_of::<Foo>() - 136usize];
+    ["Alignment of Foo"][::std::mem::align_of::<Foo>() - 4usize];
+    ["Offset of field: Foo::large"][::std::mem::offset_of!(Foo, large) - 0usize];
+};
+unsafe extern "C" {
     #[link_name = "\u{1}_ZN3Foo4typeEv"]
     pub fn Foo_type(this: *mut Foo) -> ::std::os::raw::c_char;
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}_ZN3Foo9set_type_Ec"]
     pub fn Foo_set_type_(this: *mut Foo, c: ::std::os::raw::c_char);
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}_ZN3Foo8set_typeEc"]
     pub fn Foo_set_type(this: *mut Foo, c: ::std::os::raw::c_char);
 }
@@ -130,33 +182,6 @@
         }
     }
 }
-impl ::std::fmt::Debug for Foo {
-    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        write!(
-            f,
-            "Foo {{ large: [{}], type_ : {:?},  }}",
-            {
-                use std::fmt::Write as _;
-                let mut output = String::new();
-                let mut iter = self.large.iter();
-                if let Some(value) = iter.next() {
-                    let _ = write!(output, "{value:?}");
-                    for value in iter {
-                        let _ = write!(output, ", {value:?}");
-                    }
-                }
-                output
-            },
-            self.type__bindgen_bitfield(),
-        )
-    }
-}
-impl ::std::cmp::PartialEq for Foo {
-    fn eq(&self, other: &Foo) -> bool {
-        &self.large[..] == &other.large[..]
-            && self.type__bindgen_bitfield() == other.type__bindgen_bitfield()
-    }
-}
 impl Foo {
     #[inline]
     pub fn type__bindgen_bitfield(&self) -> ::std::os::raw::c_char {
@@ -170,6 +195,35 @@
         }
     }
     #[inline]
+    pub unsafe fn type__bindgen_bitfield_raw(
+        this: *const Self,
+    ) -> ::std::os::raw::c_char {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 2usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 0usize, 3u8) as u8,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_type__bindgen_bitfield_raw(
+        this: *mut Self,
+        val: ::std::os::raw::c_char,
+    ) {
+        unsafe {
+            let val: u8 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 2usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                0usize,
+                3u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn new_bitfield_1(
         type__bindgen_bitfield: ::std::os::raw::c_char,
     ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
diff --git a/bindgen-tests/tests/expectations/tests/derive-clone.rs b/bindgen-tests/tests/expectations/tests/derive-clone.rs
index d903afa..ccbdf5b 100644
--- a/bindgen-tests/tests/expectations/tests/derive-clone.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-clone.rs
@@ -1,30 +1,20 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 /// This struct should derive `Clone`.
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone)]
 pub struct ShouldDeriveClone {
     pub large: [::std::os::raw::c_int; 33usize],
 }
-#[test]
-fn bindgen_test_layout_ShouldDeriveClone() {
-    const UNINIT: ::std::mem::MaybeUninit<ShouldDeriveClone> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<ShouldDeriveClone>(),
-        132usize,
-        "Size of ShouldDeriveClone",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<ShouldDeriveClone>(),
-        4usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of ShouldDeriveClone"][::std::mem::size_of::<ShouldDeriveClone>() - 132usize];
+    [
         "Alignment of ShouldDeriveClone",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).large) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<ShouldDeriveClone>() - 4usize];
+    [
         "Offset of field: ShouldDeriveClone::large",
-    );
-}
+    ][::std::mem::offset_of!(ShouldDeriveClone, large) - 0usize];
+};
 impl Default for ShouldDeriveClone {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
diff --git a/bindgen-tests/tests/expectations/tests/derive-debug-bitfield-1-51.rs b/bindgen-tests/tests/expectations/tests/derive-debug-bitfield-1-51.rs
index c5eed87..87cbb73 100644
--- a/bindgen-tests/tests/expectations/tests/derive-debug-bitfield-1-51.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-debug-bitfield-1-51.rs
@@ -151,18 +151,12 @@
     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
     pub large_array: [::std::os::raw::c_int; 50usize],
 }
-#[test]
-fn bindgen_test_layout_C() {
-    const UNINIT: ::std::mem::MaybeUninit<C> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<C>(), 204usize, "Size of C");
-    assert_eq!(::std::mem::align_of::<C>(), 4usize, "Alignment of C");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).large_array) as usize - ptr as usize },
-        4usize,
-        "Offset of field: C::large_array",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of C"][::std::mem::size_of::<C>() - 204usize];
+    ["Alignment of C"][::std::mem::align_of::<C>() - 4usize];
+    ["Offset of field: C::large_array"][::std::mem::offset_of!(C, large_array) - 4usize];
+};
 impl Default for C {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
diff --git a/bindgen-tests/tests/expectations/tests/derive-debug-bitfield-core.rs b/bindgen-tests/tests/expectations/tests/derive-debug-bitfield-core.rs
index baeb875..937ad4a 100644
--- a/bindgen-tests/tests/expectations/tests/derive-debug-bitfield-core.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-debug-bitfield-core.rs
@@ -33,6 +33,16 @@
         Self::extract_bit(byte, index)
     }
     #[inline]
+    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+        let byte_index = index / 8;
+        let byte = unsafe {
+            *(core::ptr::addr_of!((*this).storage) as *const u8)
+                .offset(byte_index as isize)
+        };
+        Self::extract_bit(byte, index)
+    }
+    #[inline]
     fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
         let bit_index = if cfg!(target_endian = "big") {
             7 - (index % 8)
@@ -50,6 +60,16 @@
         *byte = Self::change_bit(*byte, index, val);
     }
     #[inline]
+    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+        let byte_index = index / 8;
+        let byte = unsafe {
+            (core::ptr::addr_of_mut!((*this).storage) as *mut u8)
+                .offset(byte_index as isize)
+        };
+        unsafe { *byte = Self::change_bit(*byte, index, val) };
+    }
+    #[inline]
     pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -70,6 +90,26 @@
         val
     }
     #[inline]
+    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),
+        );
+        let mut val = 0;
+        for i in 0..(bit_width as usize) {
+            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
+                let index = if cfg!(target_endian = "big") {
+                    bit_width as usize - 1 - i
+                } else {
+                    i
+                };
+                val |= 1 << index;
+            }
+        }
+        val
+    }
+    #[inline]
     pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -87,25 +127,39 @@
             self.set_bit(index + bit_offset, val_bit_is_set);
         }
     }
+    #[inline]
+    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),
+        );
+        for i in 0..(bit_width as usize) {
+            let mask = 1 << i;
+            let val_bit_is_set = val & mask == mask;
+            let index = if cfg!(target_endian = "big") {
+                bit_width as usize - 1 - i
+            } else {
+                i
+            };
+            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
+        }
+    }
 }
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone)]
 pub struct C {
     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
-    pub large_array: [::std::os::raw::c_int; 50usize],
+    pub large_array: [::core::ffi::c_int; 50usize],
 }
-#[test]
-fn bindgen_test_layout_C() {
-    const UNINIT: ::core::mem::MaybeUninit<C> = ::core::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::core::mem::size_of::<C>(), 204usize, "Size of C");
-    assert_eq!(::core::mem::align_of::<C>(), 4usize, "Alignment of C");
-    assert_eq!(
-        unsafe { ::core::ptr::addr_of!((*ptr).large_array) as usize - ptr as usize },
-        4usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of C"][::core::mem::size_of::<C>() - 204usize];
+    ["Alignment of C"][::core::mem::align_of::<C>() - 4usize];
+    [
         "Offset of field: C::large_array",
-    );
-}
+    ][::core::mem::offset_of!(C, large_array) - 4usize];
+};
 impl Default for C {
     fn default() -> Self {
         let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
@@ -115,11 +169,6 @@
         }
     }
 }
-impl ::core::fmt::Debug for C {
-    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
-        write!(f, "C {{ a : {:?}, b : {:?}, large_array: [...] }}", self.a(), self.b())
-    }
-}
 impl C {
     #[inline]
     pub fn a(&self) -> bool {
@@ -133,6 +182,31 @@
         }
     }
     #[inline]
+    pub unsafe fn a_raw(this: *const Self) -> bool {
+        unsafe {
+            ::core::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 1usize],
+                >>::raw_get(::core::ptr::addr_of!((*this)._bitfield_1), 0usize, 1u8)
+                    as u8,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_a_raw(this: *mut Self, val: bool) {
+        unsafe {
+            let val: u8 = ::core::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 1usize],
+            >>::raw_set(
+                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
+                0usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn b(&self) -> bool {
         unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) }
     }
@@ -144,6 +218,31 @@
         }
     }
     #[inline]
+    pub unsafe fn b_raw(this: *const Self) -> bool {
+        unsafe {
+            ::core::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 1usize],
+                >>::raw_get(::core::ptr::addr_of!((*this)._bitfield_1), 1usize, 7u8)
+                    as u8,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_b_raw(this: *mut Self, val: bool) {
+        unsafe {
+            let val: u8 = ::core::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 1usize],
+            >>::raw_set(
+                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
+                1usize,
+                7u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn new_bitfield_1(a: bool, b: bool) -> __BindgenBitfieldUnit<[u8; 1usize]> {
         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
         __bindgen_bitfield_unit
diff --git a/bindgen-tests/tests/expectations/tests/derive-debug-bitfield.rs b/bindgen-tests/tests/expectations/tests/derive-debug-bitfield.rs
index e414b6f..87cbb73 100644
--- a/bindgen-tests/tests/expectations/tests/derive-debug-bitfield.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-debug-bitfield.rs
@@ -32,6 +32,16 @@
         Self::extract_bit(byte, index)
     }
     #[inline]
+    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+        let byte_index = index / 8;
+        let byte = unsafe {
+            *(core::ptr::addr_of!((*this).storage) as *const u8)
+                .offset(byte_index as isize)
+        };
+        Self::extract_bit(byte, index)
+    }
+    #[inline]
     fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
         let bit_index = if cfg!(target_endian = "big") {
             7 - (index % 8)
@@ -49,6 +59,16 @@
         *byte = Self::change_bit(*byte, index, val);
     }
     #[inline]
+    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+        let byte_index = index / 8;
+        let byte = unsafe {
+            (core::ptr::addr_of_mut!((*this).storage) as *mut u8)
+                .offset(byte_index as isize)
+        };
+        unsafe { *byte = Self::change_bit(*byte, index, val) };
+    }
+    #[inline]
     pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -69,6 +89,26 @@
         val
     }
     #[inline]
+    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),
+        );
+        let mut val = 0;
+        for i in 0..(bit_width as usize) {
+            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
+                let index = if cfg!(target_endian = "big") {
+                    bit_width as usize - 1 - i
+                } else {
+                    i
+                };
+                val |= 1 << index;
+            }
+        }
+        val
+    }
+    #[inline]
     pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -86,25 +126,37 @@
             self.set_bit(index + bit_offset, val_bit_is_set);
         }
     }
+    #[inline]
+    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),
+        );
+        for i in 0..(bit_width as usize) {
+            let mask = 1 << i;
+            let val_bit_is_set = val & mask == mask;
+            let index = if cfg!(target_endian = "big") {
+                bit_width as usize - 1 - i
+            } else {
+                i
+            };
+            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
+        }
+    }
 }
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone)]
 pub struct C {
     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
     pub large_array: [::std::os::raw::c_int; 50usize],
 }
-#[test]
-fn bindgen_test_layout_C() {
-    const UNINIT: ::std::mem::MaybeUninit<C> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<C>(), 204usize, "Size of C");
-    assert_eq!(::std::mem::align_of::<C>(), 4usize, "Alignment of C");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).large_array) as usize - ptr as usize },
-        4usize,
-        "Offset of field: C::large_array",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of C"][::std::mem::size_of::<C>() - 204usize];
+    ["Alignment of C"][::std::mem::align_of::<C>() - 4usize];
+    ["Offset of field: C::large_array"][::std::mem::offset_of!(C, large_array) - 4usize];
+};
 impl Default for C {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -114,28 +166,6 @@
         }
     }
 }
-impl ::std::fmt::Debug for C {
-    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        write!(
-            f,
-            "C {{ a : {:?}, b : {:?}, large_array: [{}] }}",
-            self.a(),
-            self.b(),
-            {
-                use std::fmt::Write as _;
-                let mut output = String::new();
-                let mut iter = self.large_array.iter();
-                if let Some(value) = iter.next() {
-                    let _ = write!(output, "{value:?}");
-                    for value in iter {
-                        let _ = write!(output, ", {value:?}");
-                    }
-                }
-                output
-            },
-        )
-    }
-}
 impl C {
     #[inline]
     pub fn a(&self) -> bool {
@@ -149,6 +179,30 @@
         }
     }
     #[inline]
+    pub unsafe fn a_raw(this: *const Self) -> bool {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 1usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 0usize, 1u8) as u8,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_a_raw(this: *mut Self, val: bool) {
+        unsafe {
+            let val: u8 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 1usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                0usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn b(&self) -> bool {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) }
     }
@@ -160,6 +214,30 @@
         }
     }
     #[inline]
+    pub unsafe fn b_raw(this: *const Self) -> bool {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 1usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 1usize, 7u8) as u8,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_b_raw(this: *mut Self, val: bool) {
+        unsafe {
+            let val: u8 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 1usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                1usize,
+                7u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn new_bitfield_1(a: bool, b: bool) -> __BindgenBitfieldUnit<[u8; 1usize]> {
         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
         __bindgen_bitfield_unit
diff --git a/bindgen-tests/tests/expectations/tests/derive-debug-function-pointer.rs b/bindgen-tests/tests/expectations/tests/derive-debug-function-pointer.rs
index 9fe1f55..eaaa8ef 100644
--- a/bindgen-tests/tests/expectations/tests/derive-debug-function-pointer.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-debug-function-pointer.rs
@@ -1,6 +1,6 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone)]
 pub struct Nice {
     pub pointer: Nice_Function,
     pub large_array: [::std::os::raw::c_int; 34usize],
@@ -8,23 +8,15 @@
 pub type Nice_Function = ::std::option::Option<
     unsafe extern "C" fn(data: ::std::os::raw::c_int),
 >;
-#[test]
-fn bindgen_test_layout_Nice() {
-    const UNINIT: ::std::mem::MaybeUninit<Nice> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<Nice>(), 144usize, "Size of Nice");
-    assert_eq!(::std::mem::align_of::<Nice>(), 8usize, "Alignment of Nice");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pointer) as usize - ptr as usize },
-        0usize,
-        "Offset of field: Nice::pointer",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).large_array) as usize - ptr as usize },
-        8usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Nice"][::std::mem::size_of::<Nice>() - 144usize];
+    ["Alignment of Nice"][::std::mem::align_of::<Nice>() - 8usize];
+    ["Offset of field: Nice::pointer"][::std::mem::offset_of!(Nice, pointer) - 0usize];
+    [
         "Offset of field: Nice::large_array",
-    );
-}
+    ][::std::mem::offset_of!(Nice, large_array) - 8usize];
+};
 impl Default for Nice {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -34,24 +26,3 @@
         }
     }
 }
-impl ::std::fmt::Debug for Nice {
-    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        write!(
-            f,
-            "Nice {{ pointer: {:?}, large_array: [{}] }}",
-            self.pointer,
-            {
-                use std::fmt::Write as _;
-                let mut output = String::new();
-                let mut iter = self.large_array.iter();
-                if let Some(value) = iter.next() {
-                    let _ = write!(output, "{value:?}");
-                    for value in iter {
-                        let _ = write!(output, ", {value:?}");
-                    }
-                }
-                output
-            },
-        )
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/derive-debug-generic.rs b/bindgen-tests/tests/expectations/tests/derive-debug-generic.rs
index de6ce38..86e5304 100644
--- a/bindgen-tests/tests/expectations/tests/derive-debug-generic.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-debug-generic.rs
@@ -1,5 +1,6 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 #[repr(C)]
+#[derive(Debug)]
 pub struct Generic<T> {
     pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
     pub t: [T; 40usize],
@@ -13,8 +14,3 @@
         }
     }
 }
-impl<T> ::std::fmt::Debug for Generic<T> {
-    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        write!(f, "Generic {{ t: Array with length 40 }}")
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs b/bindgen-tests/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs
index d586278..ac564a3 100644
--- a/bindgen-tests/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs
@@ -1,20 +1,24 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+/// If Bindgen could only determine the size and alignment of a
+/// type, it is represented like this.
+#[derive(PartialEq, Copy, Clone, Debug, Hash)]
+#[repr(C)]
+pub struct __BindgenOpaqueArray<T: Copy, const N: usize>(pub [T; N]);
+impl<T: Copy + Default, const N: usize> Default for __BindgenOpaqueArray<T, N> {
+    fn default() -> Self {
+        Self([<T as Default>::default(); N])
+    }
+}
 #[repr(C)]
 pub struct Instance {
-    pub val: [u32; 50usize],
+    pub val: __BindgenOpaqueArray<u32, 50usize>,
 }
-#[test]
-fn bindgen_test_layout_Instance() {
-    const UNINIT: ::std::mem::MaybeUninit<Instance> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<Instance>(), 200usize, "Size of Instance");
-    assert_eq!(::std::mem::align_of::<Instance>(), 4usize, "Alignment of Instance");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize },
-        0usize,
-        "Offset of field: Instance::val",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Instance"][::std::mem::size_of::<Instance>() - 200usize];
+    ["Alignment of Instance"][::std::mem::align_of::<Instance>() - 4usize];
+    ["Offset of field: Instance::val"][::std::mem::offset_of!(Instance, val) - 0usize];
+};
 impl Default for Instance {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
diff --git a/bindgen-tests/tests/expectations/tests/derive-debug-opaque.rs b/bindgen-tests/tests/expectations/tests/derive-debug-opaque.rs
index 13ddfd5..c8b3f10 100644
--- a/bindgen-tests/tests/expectations/tests/derive-debug-opaque.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-debug-opaque.rs
@@ -4,11 +4,11 @@
 pub struct Opaque {
     pub _bindgen_opaque_blob: [u32; 41usize],
 }
-#[test]
-fn bindgen_test_layout_Opaque() {
-    assert_eq!(::std::mem::size_of::<Opaque>(), 164usize, "Size of Opaque");
-    assert_eq!(::std::mem::align_of::<Opaque>(), 4usize, "Alignment of Opaque");
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Opaque"][::std::mem::size_of::<Opaque>() - 164usize];
+    ["Alignment of Opaque"][::std::mem::align_of::<Opaque>() - 4usize];
+};
 impl Default for Opaque {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -27,18 +27,14 @@
 pub struct OpaqueUser {
     pub opaque: Opaque,
 }
-#[test]
-fn bindgen_test_layout_OpaqueUser() {
-    const UNINIT: ::std::mem::MaybeUninit<OpaqueUser> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<OpaqueUser>(), 164usize, "Size of OpaqueUser");
-    assert_eq!(::std::mem::align_of::<OpaqueUser>(), 4usize, "Alignment of OpaqueUser");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of OpaqueUser"][::std::mem::size_of::<OpaqueUser>() - 164usize];
+    ["Alignment of OpaqueUser"][::std::mem::align_of::<OpaqueUser>() - 4usize];
+    [
         "Offset of field: OpaqueUser::opaque",
-    );
-}
+    ][::std::mem::offset_of!(OpaqueUser, opaque) - 0usize];
+};
 impl Default for OpaqueUser {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
diff --git a/bindgen-tests/tests/expectations/tests/derive-partialeq-base.rs b/bindgen-tests/tests/expectations/tests/derive-partialeq-base.rs
index d076841..3ca262f 100644
--- a/bindgen-tests/tests/expectations/tests/derive-partialeq-base.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-partialeq-base.rs
@@ -1,21 +1,15 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, PartialEq)]
 pub struct Base {
     pub large: [::std::os::raw::c_int; 33usize],
 }
-#[test]
-fn bindgen_test_layout_Base() {
-    const UNINIT: ::std::mem::MaybeUninit<Base> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<Base>(), 132usize, "Size of Base");
-    assert_eq!(::std::mem::align_of::<Base>(), 4usize, "Alignment of Base");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).large) as usize - ptr as usize },
-        0usize,
-        "Offset of field: Base::large",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Base"][::std::mem::size_of::<Base>() - 132usize];
+    ["Alignment of Base"][::std::mem::align_of::<Base>() - 4usize];
+    ["Offset of field: Base::large"][::std::mem::offset_of!(Base, large) - 0usize];
+};
 impl Default for Base {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -25,29 +19,20 @@
         }
     }
 }
-impl ::std::cmp::PartialEq for Base {
-    fn eq(&self, other: &Base) -> bool {
-        &self.large[..] == &other.large[..]
-    }
-}
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, PartialEq)]
 pub struct ShouldDerivePartialEq {
     pub _base: Base,
 }
-#[test]
-fn bindgen_test_layout_ShouldDerivePartialEq() {
-    assert_eq!(
-        ::std::mem::size_of::<ShouldDerivePartialEq>(),
-        132usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of ShouldDerivePartialEq",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<ShouldDerivePartialEq>(),
-        4usize,
+    ][::std::mem::size_of::<ShouldDerivePartialEq>() - 132usize];
+    [
         "Alignment of ShouldDerivePartialEq",
-    );
-}
+    ][::std::mem::align_of::<ShouldDerivePartialEq>() - 4usize];
+};
 impl Default for ShouldDerivePartialEq {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -57,8 +42,3 @@
         }
     }
 }
-impl ::std::cmp::PartialEq for ShouldDerivePartialEq {
-    fn eq(&self, other: &ShouldDerivePartialEq) -> bool {
-        self._base == other._base
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/derive-partialeq-bitfield.rs b/bindgen-tests/tests/expectations/tests/derive-partialeq-bitfield.rs
index 7bcdce3..b8da88e 100644
--- a/bindgen-tests/tests/expectations/tests/derive-partialeq-bitfield.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-partialeq-bitfield.rs
@@ -32,6 +32,16 @@
         Self::extract_bit(byte, index)
     }
     #[inline]
+    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+        let byte_index = index / 8;
+        let byte = unsafe {
+            *(core::ptr::addr_of!((*this).storage) as *const u8)
+                .offset(byte_index as isize)
+        };
+        Self::extract_bit(byte, index)
+    }
+    #[inline]
     fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
         let bit_index = if cfg!(target_endian = "big") {
             7 - (index % 8)
@@ -49,6 +59,16 @@
         *byte = Self::change_bit(*byte, index, val);
     }
     #[inline]
+    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+        let byte_index = index / 8;
+        let byte = unsafe {
+            (core::ptr::addr_of_mut!((*this).storage) as *mut u8)
+                .offset(byte_index as isize)
+        };
+        unsafe { *byte = Self::change_bit(*byte, index, val) };
+    }
+    #[inline]
     pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -69,6 +89,26 @@
         val
     }
     #[inline]
+    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),
+        );
+        let mut val = 0;
+        for i in 0..(bit_width as usize) {
+            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
+                let index = if cfg!(target_endian = "big") {
+                    bit_width as usize - 1 - i
+                } else {
+                    i
+                };
+                val |= 1 << index;
+            }
+        }
+        val
+    }
+    #[inline]
     pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -86,25 +126,37 @@
             self.set_bit(index + bit_offset, val_bit_is_set);
         }
     }
+    #[inline]
+    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),
+        );
+        for i in 0..(bit_width as usize) {
+            let mask = 1 << i;
+            let val_bit_is_set = val & mask == mask;
+            let index = if cfg!(target_endian = "big") {
+                bit_width as usize - 1 - i
+            } else {
+                i
+            };
+            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
+        }
+    }
 }
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, PartialEq)]
 pub struct C {
     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
     pub large_array: [::std::os::raw::c_int; 50usize],
 }
-#[test]
-fn bindgen_test_layout_C() {
-    const UNINIT: ::std::mem::MaybeUninit<C> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<C>(), 204usize, "Size of C");
-    assert_eq!(::std::mem::align_of::<C>(), 4usize, "Alignment of C");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).large_array) as usize - ptr as usize },
-        4usize,
-        "Offset of field: C::large_array",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of C"][::std::mem::size_of::<C>() - 204usize];
+    ["Alignment of C"][::std::mem::align_of::<C>() - 4usize];
+    ["Offset of field: C::large_array"][::std::mem::offset_of!(C, large_array) - 4usize];
+};
 impl Default for C {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -114,12 +166,6 @@
         }
     }
 }
-impl ::std::cmp::PartialEq for C {
-    fn eq(&self, other: &C) -> bool {
-        self.a() == other.a() && self.b() == other.b()
-            && &self.large_array[..] == &other.large_array[..]
-    }
-}
 impl C {
     #[inline]
     pub fn a(&self) -> bool {
@@ -133,6 +179,30 @@
         }
     }
     #[inline]
+    pub unsafe fn a_raw(this: *const Self) -> bool {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 1usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 0usize, 1u8) as u8,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_a_raw(this: *mut Self, val: bool) {
+        unsafe {
+            let val: u8 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 1usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                0usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn b(&self) -> bool {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) }
     }
@@ -144,6 +214,30 @@
         }
     }
     #[inline]
+    pub unsafe fn b_raw(this: *const Self) -> bool {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 1usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 1usize, 7u8) as u8,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_b_raw(this: *mut Self, val: bool) {
+        unsafe {
+            let val: u8 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 1usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                1usize,
+                7u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn new_bitfield_1(a: bool, b: bool) -> __BindgenBitfieldUnit<[u8; 1usize]> {
         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
         __bindgen_bitfield_unit
diff --git a/bindgen-tests/tests/expectations/tests/derive-partialeq-core.rs b/bindgen-tests/tests/expectations/tests/derive-partialeq-core.rs
index 3a7639f..9a36b8f 100644
--- a/bindgen-tests/tests/expectations/tests/derive-partialeq-core.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-partialeq-core.rs
@@ -1,22 +1,18 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 extern crate core;
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, PartialEq)]
 pub struct C {
-    pub large_array: [::std::os::raw::c_int; 420usize],
+    pub large_array: [::core::ffi::c_int; 420usize],
 }
-#[test]
-fn bindgen_test_layout_C() {
-    const UNINIT: ::core::mem::MaybeUninit<C> = ::core::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::core::mem::size_of::<C>(), 1680usize, "Size of C");
-    assert_eq!(::core::mem::align_of::<C>(), 4usize, "Alignment of C");
-    assert_eq!(
-        unsafe { ::core::ptr::addr_of!((*ptr).large_array) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of C"][::core::mem::size_of::<C>() - 1680usize];
+    ["Alignment of C"][::core::mem::align_of::<C>() - 4usize];
+    [
         "Offset of field: C::large_array",
-    );
-}
+    ][::core::mem::offset_of!(C, large_array) - 0usize];
+};
 impl Default for C {
     fn default() -> Self {
         let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
@@ -26,8 +22,3 @@
         }
     }
 }
-impl ::core::cmp::PartialEq for C {
-    fn eq(&self, other: &C) -> bool {
-        &self.large_array[..] == &other.large_array[..]
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/extern-const-struct.rs b/bindgen-tests/tests/expectations/tests/extern-const-struct.rs
index c449e1a..7085bef 100644
--- a/bindgen-tests/tests/expectations/tests/extern-const-struct.rs
+++ b/bindgen-tests/tests/expectations/tests/extern-const-struct.rs
@@ -1,21 +1,15 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone)]
 pub struct nsFoo {
     pub details: [f32; 400usize],
 }
-#[test]
-fn bindgen_test_layout_nsFoo() {
-    const UNINIT: ::std::mem::MaybeUninit<nsFoo> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<nsFoo>(), 1600usize, "Size of nsFoo");
-    assert_eq!(::std::mem::align_of::<nsFoo>(), 4usize, "Alignment of nsFoo");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize },
-        0usize,
-        "Offset of field: nsFoo::details",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of nsFoo"][::std::mem::size_of::<nsFoo>() - 1600usize];
+    ["Alignment of nsFoo"][::std::mem::align_of::<nsFoo>() - 4usize];
+    ["Offset of field: nsFoo::details"][::std::mem::offset_of!(nsFoo, details) - 0usize];
+};
 impl Default for nsFoo {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -25,6 +19,6 @@
         }
     }
 }
-extern "C" {
+unsafe extern "C" {
     pub static gDetails: nsFoo;
 }
diff --git a/bindgen-tests/tests/expectations/tests/extern_blocks_pre_1_82.rs b/bindgen-tests/tests/expectations/tests/extern_blocks_pre_1_82.rs
index 9f68408..a322df7 100644
--- a/bindgen-tests/tests/expectations/tests/extern_blocks_pre_1_82.rs
+++ b/bindgen-tests/tests/expectations/tests/extern_blocks_pre_1_82.rs
@@ -1,7 +1,7 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-extern "C" {
+unsafe extern "C" {
     pub fn cool_function(i: ::std::os::raw::c_int, c: ::std::os::raw::c_char);
 }
-extern "C" {
+unsafe extern "C" {
     pub static mut cool_static: ::std::os::raw::c_int;
 }
diff --git a/bindgen-tests/tests/expectations/tests/i128.rs b/bindgen-tests/tests/expectations/tests/i128.rs
index 87459b5..e29db49 100644
--- a/bindgen-tests/tests/expectations/tests/i128.rs
+++ b/bindgen-tests/tests/expectations/tests/i128.rs
@@ -6,20 +6,12 @@
     pub my_signed: i128,
     pub my_unsigned: u128,
 }
-#[test]
-fn bindgen_test_layout_foo() {
-    const UNINIT: ::std::mem::MaybeUninit<foo> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<foo>(), 32usize, "Size of foo");
-    assert_eq!(::std::mem::align_of::<foo>(), 16usize, "Alignment of foo");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).my_signed) as usize - ptr as usize },
-        0usize,
-        "Offset of field: foo::my_signed",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).my_unsigned) as usize - ptr as usize },
-        16usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of foo"][::std::mem::size_of::<foo>() - 32usize];
+    ["Alignment of foo"][::std::mem::align_of::<foo>() - 16usize];
+    ["Offset of field: foo::my_signed"][::std::mem::offset_of!(foo, my_signed) - 0usize];
+    [
         "Offset of field: foo::my_unsigned",
-    );
-}
+    ][::std::mem::offset_of!(foo, my_unsigned) - 16usize];
+};
diff --git a/bindgen-tests/tests/expectations/tests/issue-1291.rs b/bindgen-tests/tests/expectations/tests/issue-1291.rs
index 190e899..3c3fab3 100644
--- a/bindgen-tests/tests/expectations/tests/issue-1291.rs
+++ b/bindgen-tests/tests/expectations/tests/issue-1291.rs
@@ -19,85 +19,35 @@
     pub primID: ::std::os::raw::c_uint,
     pub instID: ::std::os::raw::c_uint,
 }
-#[test]
-fn bindgen_test_layout_RTCRay() {
-    const UNINIT: ::std::mem::MaybeUninit<RTCRay> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<RTCRay>(), 96usize, "Size of RTCRay");
-    assert_eq!(::std::mem::align_of::<RTCRay>(), 16usize, "Alignment of RTCRay");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).org) as usize - ptr as usize },
-        0usize,
-        "Offset of field: RTCRay::org",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).align0) as usize - ptr as usize },
-        12usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of RTCRay"][::std::mem::size_of::<RTCRay>() - 96usize];
+    ["Alignment of RTCRay"][::std::mem::align_of::<RTCRay>() - 16usize];
+    ["Offset of field: RTCRay::org"][::std::mem::offset_of!(RTCRay, org) - 0usize];
+    [
         "Offset of field: RTCRay::align0",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dir) as usize - ptr as usize },
-        16usize,
-        "Offset of field: RTCRay::dir",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).align1) as usize - ptr as usize },
-        28usize,
+    ][::std::mem::offset_of!(RTCRay, align0) - 12usize];
+    ["Offset of field: RTCRay::dir"][::std::mem::offset_of!(RTCRay, dir) - 16usize];
+    [
         "Offset of field: RTCRay::align1",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tnear) as usize - ptr as usize },
-        32usize,
-        "Offset of field: RTCRay::tnear",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tfar) as usize - ptr as usize },
-        36usize,
-        "Offset of field: RTCRay::tfar",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
-        40usize,
-        "Offset of field: RTCRay::time",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize },
-        44usize,
-        "Offset of field: RTCRay::mask",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).Ng) as usize - ptr as usize },
-        48usize,
-        "Offset of field: RTCRay::Ng",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).align2) as usize - ptr as usize },
-        60usize,
+    ][::std::mem::offset_of!(RTCRay, align1) - 28usize];
+    ["Offset of field: RTCRay::tnear"][::std::mem::offset_of!(RTCRay, tnear) - 32usize];
+    ["Offset of field: RTCRay::tfar"][::std::mem::offset_of!(RTCRay, tfar) - 36usize];
+    ["Offset of field: RTCRay::time"][::std::mem::offset_of!(RTCRay, time) - 40usize];
+    ["Offset of field: RTCRay::mask"][::std::mem::offset_of!(RTCRay, mask) - 44usize];
+    ["Offset of field: RTCRay::Ng"][::std::mem::offset_of!(RTCRay, Ng) - 48usize];
+    [
         "Offset of field: RTCRay::align2",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize },
-        64usize,
-        "Offset of field: RTCRay::u",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize },
-        68usize,
-        "Offset of field: RTCRay::v",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).geomID) as usize - ptr as usize },
-        72usize,
+    ][::std::mem::offset_of!(RTCRay, align2) - 60usize];
+    ["Offset of field: RTCRay::u"][::std::mem::offset_of!(RTCRay, u) - 64usize];
+    ["Offset of field: RTCRay::v"][::std::mem::offset_of!(RTCRay, v) - 68usize];
+    [
         "Offset of field: RTCRay::geomID",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).primID) as usize - ptr as usize },
-        76usize,
+    ][::std::mem::offset_of!(RTCRay, geomID) - 72usize];
+    [
         "Offset of field: RTCRay::primID",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).instID) as usize - ptr as usize },
-        80usize,
+    ][::std::mem::offset_of!(RTCRay, primID) - 76usize];
+    [
         "Offset of field: RTCRay::instID",
-    );
-}
+    ][::std::mem::offset_of!(RTCRay, instID) - 80usize];
+};
diff --git a/bindgen-tests/tests/expectations/tests/issue-372.rs b/bindgen-tests/tests/expectations/tests/issue-372.rs
index 80b8cbe..62160d6 100644
--- a/bindgen-tests/tests/expectations/tests/issue-372.rs
+++ b/bindgen-tests/tests/expectations/tests/issue-372.rs
@@ -1,6 +1,16 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
 pub mod root {
+    /// If Bindgen could only determine the size and alignment of a
+    /// type, it is represented like this.
+    #[derive(PartialEq, Copy, Clone, Debug, Hash)]
+    #[repr(C)]
+    pub struct __BindgenOpaqueArray<T: Copy, const N: usize>(pub [T; N]);
+    impl<T: Copy + Default, const N: usize> Default for __BindgenOpaqueArray<T, N> {
+        fn default() -> Self {
+            Self([<T as Default>::default(); N])
+        }
+    }
     #[allow(unused_imports)]
     use self::super::root;
     #[repr(C)]
@@ -10,28 +20,14 @@
         pub k: *mut root::i,
         pub l: bool,
     }
-    #[test]
-    fn bindgen_test_layout_i() {
-        const UNINIT: ::std::mem::MaybeUninit<i> = ::std::mem::MaybeUninit::uninit();
-        let ptr = UNINIT.as_ptr();
-        assert_eq!(::std::mem::size_of::<i>(), 24usize, "Size of i");
-        assert_eq!(::std::mem::align_of::<i>(), 8usize, "Alignment of i");
-        assert_eq!(
-            unsafe { ::std::ptr::addr_of!((*ptr).j) as usize - ptr as usize },
-            0usize,
-            "Offset of field: i::j",
-        );
-        assert_eq!(
-            unsafe { ::std::ptr::addr_of!((*ptr).k) as usize - ptr as usize },
-            8usize,
-            "Offset of field: i::k",
-        );
-        assert_eq!(
-            unsafe { ::std::ptr::addr_of!((*ptr).l) as usize - ptr as usize },
-            16usize,
-            "Offset of field: i::l",
-        );
-    }
+    #[allow(clippy::unnecessary_operation, clippy::identity_op)]
+    const _: () = {
+        ["Size of i"][::std::mem::size_of::<i>() - 24usize];
+        ["Alignment of i"][::std::mem::align_of::<i>() - 8usize];
+        ["Offset of field: i::j"][::std::mem::offset_of!(i, j) - 0usize];
+        ["Offset of field: i::k"][::std::mem::offset_of!(i, k) - 8usize];
+        ["Offset of field: i::l"][::std::mem::offset_of!(i, l) - 16usize];
+    };
     impl Default for i {
         fn default() -> Self {
             let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -46,18 +42,12 @@
     pub struct d {
         pub m: root::i,
     }
-    #[test]
-    fn bindgen_test_layout_d() {
-        const UNINIT: ::std::mem::MaybeUninit<d> = ::std::mem::MaybeUninit::uninit();
-        let ptr = UNINIT.as_ptr();
-        assert_eq!(::std::mem::size_of::<d>(), 24usize, "Size of d");
-        assert_eq!(::std::mem::align_of::<d>(), 8usize, "Alignment of d");
-        assert_eq!(
-            unsafe { ::std::ptr::addr_of!((*ptr).m) as usize - ptr as usize },
-            0usize,
-            "Offset of field: d::m",
-        );
-    }
+    #[allow(clippy::unnecessary_operation, clippy::identity_op)]
+    const _: () = {
+        ["Size of d"][::std::mem::size_of::<d>() - 24usize];
+        ["Alignment of d"][::std::mem::align_of::<d>() - 8usize];
+        ["Offset of field: d::m"][::std::mem::offset_of!(d, m) - 0usize];
+    };
     impl Default for d {
         fn default() -> Self {
             let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -85,20 +75,14 @@
     }
     #[repr(C)]
     pub struct F {
-        pub w: [u64; 33usize],
+        pub w: root::__BindgenOpaqueArray<u64, 33usize>,
     }
-    #[test]
-    fn bindgen_test_layout_F() {
-        const UNINIT: ::std::mem::MaybeUninit<F> = ::std::mem::MaybeUninit::uninit();
-        let ptr = UNINIT.as_ptr();
-        assert_eq!(::std::mem::size_of::<F>(), 264usize, "Size of F");
-        assert_eq!(::std::mem::align_of::<F>(), 8usize, "Alignment of F");
-        assert_eq!(
-            unsafe { ::std::ptr::addr_of!((*ptr).w) as usize - ptr as usize },
-            0usize,
-            "Offset of field: F::w",
-        );
-    }
+    #[allow(clippy::unnecessary_operation, clippy::identity_op)]
+    const _: () = {
+        ["Size of F"][::std::mem::size_of::<F>() - 264usize];
+        ["Alignment of F"][::std::mem::align_of::<F>() - 8usize];
+        ["Offset of field: F::w"][::std::mem::offset_of!(F, w) - 0usize];
+    };
     impl Default for F {
         fn default() -> Self {
             let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
diff --git a/bindgen-tests/tests/expectations/tests/issue-537-repr-packed-n.rs b/bindgen-tests/tests/expectations/tests/issue-537-repr-packed-n.rs
index 0142673..881cb9c 100644
--- a/bindgen-tests/tests/expectations/tests/issue-537-repr-packed-n.rs
+++ b/bindgen-tests/tests/expectations/tests/issue-537-repr-packed-n.rs
@@ -7,44 +7,28 @@
 pub struct AlignedToOne {
     pub i: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_AlignedToOne() {
-    const UNINIT: ::std::mem::MaybeUninit<AlignedToOne> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<AlignedToOne>(), 4usize, "Size of AlignedToOne");
-    assert_eq!(
-        ::std::mem::align_of::<AlignedToOne>(),
-        1usize,
-        "Alignment of AlignedToOne",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).i) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of AlignedToOne"][::std::mem::size_of::<AlignedToOne>() - 4usize];
+    ["Alignment of AlignedToOne"][::std::mem::align_of::<AlignedToOne>() - 1usize];
+    [
         "Offset of field: AlignedToOne::i",
-    );
-}
+    ][::std::mem::offset_of!(AlignedToOne, i) - 0usize];
+};
 /// This should be packed because Rust 1.33 has `#[repr(packed(N))]`.
 #[repr(C, packed(2))]
 #[derive(Debug, Default, Copy, Clone)]
 pub struct AlignedToTwo {
     pub i: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_AlignedToTwo() {
-    const UNINIT: ::std::mem::MaybeUninit<AlignedToTwo> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<AlignedToTwo>(), 4usize, "Size of AlignedToTwo");
-    assert_eq!(
-        ::std::mem::align_of::<AlignedToTwo>(),
-        2usize,
-        "Alignment of AlignedToTwo",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).i) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of AlignedToTwo"][::std::mem::size_of::<AlignedToTwo>() - 4usize];
+    ["Alignment of AlignedToTwo"][::std::mem::align_of::<AlignedToTwo>() - 2usize];
+    [
         "Offset of field: AlignedToTwo::i",
-    );
-}
+    ][::std::mem::offset_of!(AlignedToTwo, i) - 0usize];
+};
 /** This should not be opaque because although `libclang` doesn't give us the
  `#pragma pack(1)`, we can detect that alignment is 1 and add
  `#[repr(packed)]` to the struct ourselves.*/
@@ -54,27 +38,13 @@
     pub x: ::std::os::raw::c_int,
     pub y: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_PackedToOne() {
-    const UNINIT: ::std::mem::MaybeUninit<PackedToOne> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<PackedToOne>(), 8usize, "Size of PackedToOne");
-    assert_eq!(
-        ::std::mem::align_of::<PackedToOne>(),
-        1usize,
-        "Alignment of PackedToOne",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
-        0usize,
-        "Offset of field: PackedToOne::x",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
-        4usize,
-        "Offset of field: PackedToOne::y",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of PackedToOne"][::std::mem::size_of::<PackedToOne>() - 8usize];
+    ["Alignment of PackedToOne"][::std::mem::align_of::<PackedToOne>() - 1usize];
+    ["Offset of field: PackedToOne::x"][::std::mem::offset_of!(PackedToOne, x) - 0usize];
+    ["Offset of field: PackedToOne::y"][::std::mem::offset_of!(PackedToOne, y) - 4usize];
+};
 /// This should be packed because Rust 1.33 has `#[repr(packed(N))]`.
 #[repr(C, packed(2))]
 #[derive(Debug, Default, Copy, Clone)]
@@ -82,24 +52,10 @@
     pub x: ::std::os::raw::c_int,
     pub y: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_PackedToTwo() {
-    const UNINIT: ::std::mem::MaybeUninit<PackedToTwo> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<PackedToTwo>(), 8usize, "Size of PackedToTwo");
-    assert_eq!(
-        ::std::mem::align_of::<PackedToTwo>(),
-        2usize,
-        "Alignment of PackedToTwo",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
-        0usize,
-        "Offset of field: PackedToTwo::x",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
-        4usize,
-        "Offset of field: PackedToTwo::y",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of PackedToTwo"][::std::mem::size_of::<PackedToTwo>() - 8usize];
+    ["Alignment of PackedToTwo"][::std::mem::align_of::<PackedToTwo>() - 2usize];
+    ["Offset of field: PackedToTwo::x"][::std::mem::offset_of!(PackedToTwo, x) - 0usize];
+    ["Offset of field: PackedToTwo::y"][::std::mem::offset_of!(PackedToTwo, y) - 4usize];
+};
diff --git a/bindgen-tests/tests/expectations/tests/issue-648-derive-debug-with-padding.rs b/bindgen-tests/tests/expectations/tests/issue-648-derive-debug-with-padding.rs
index 08e47bc..5d87159 100644
--- a/bindgen-tests/tests/expectations/tests/issue-648-derive-debug-with-padding.rs
+++ b/bindgen-tests/tests/expectations/tests/issue-648-derive-debug-with-padding.rs
@@ -3,22 +3,16 @@
  Debug/Hash because 63 is over the hard coded limit.*/
 #[repr(C)]
 #[repr(align(64))]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct NoDebug {
     pub c: ::std::os::raw::c_char,
 }
-#[test]
-fn bindgen_test_layout_NoDebug() {
-    const UNINIT: ::std::mem::MaybeUninit<NoDebug> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<NoDebug>(), 64usize, "Size of NoDebug");
-    assert_eq!(::std::mem::align_of::<NoDebug>(), 64usize, "Alignment of NoDebug");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).c) as usize - ptr as usize },
-        0usize,
-        "Offset of field: NoDebug::c",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of NoDebug"][::std::mem::size_of::<NoDebug>() - 64usize];
+    ["Alignment of NoDebug"][::std::mem::align_of::<NoDebug>() - 64usize];
+    ["Offset of field: NoDebug::c"][::std::mem::offset_of!(NoDebug, c) - 0usize];
+};
 impl Default for NoDebug {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -28,47 +22,32 @@
         }
     }
 }
-impl ::std::cmp::PartialEq for NoDebug {
-    fn eq(&self, other: &NoDebug) -> bool {
-        self.c == other.c
-    }
-}
 /** This should derive Debug/Hash/PartialEq/Eq because the padding size is less than the max derive
  Debug/Hash/PartialEq/Eq impl for arrays. However, we conservatively don't derive Debug/Hash because
  we determine Debug derive-ability before we compute padding, which happens at
  codegen.*/
 #[repr(C)]
 #[repr(align(64))]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct ShouldDeriveDebugButDoesNot {
     pub c: [::std::os::raw::c_char; 32usize],
     pub d: ::std::os::raw::c_char,
 }
-#[test]
-fn bindgen_test_layout_ShouldDeriveDebugButDoesNot() {
-    const UNINIT: ::std::mem::MaybeUninit<ShouldDeriveDebugButDoesNot> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<ShouldDeriveDebugButDoesNot>(),
-        64usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of ShouldDeriveDebugButDoesNot",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<ShouldDeriveDebugButDoesNot>(),
-        64usize,
+    ][::std::mem::size_of::<ShouldDeriveDebugButDoesNot>() - 64usize];
+    [
         "Alignment of ShouldDeriveDebugButDoesNot",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).c) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<ShouldDeriveDebugButDoesNot>() - 64usize];
+    [
         "Offset of field: ShouldDeriveDebugButDoesNot::c",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize },
-        32usize,
+    ][::std::mem::offset_of!(ShouldDeriveDebugButDoesNot, c) - 0usize];
+    [
         "Offset of field: ShouldDeriveDebugButDoesNot::d",
-    );
-}
+    ][::std::mem::offset_of!(ShouldDeriveDebugButDoesNot, d) - 32usize];
+};
 impl Default for ShouldDeriveDebugButDoesNot {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -78,8 +57,3 @@
         }
     }
 }
-impl ::std::cmp::PartialEq for ShouldDeriveDebugButDoesNot {
-    fn eq(&self, other: &ShouldDeriveDebugButDoesNot) -> bool {
-        self.c == other.c && self.d == other.d
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/layout_array.rs b/bindgen-tests/tests/expectations/tests/layout_array.rs
index b910159..a2805b7 100644
--- a/bindgen-tests/tests/expectations/tests/layout_array.rs
+++ b/bindgen-tests/tests/expectations/tests/layout_array.rs
@@ -46,7 +46,7 @@
 /// Structure defining mempool operations structure
 #[repr(C)]
 #[repr(align(64))]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct rte_mempool_ops {
     ///< Name of mempool ops struct.
     pub name: [::std::os::raw::c_char; 32usize],
@@ -61,51 +61,31 @@
     ///< Get qty of available objs.
     pub get_count: rte_mempool_get_count,
 }
-#[test]
-fn bindgen_test_layout_rte_mempool_ops() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_mempool_ops> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_mempool_ops>(),
-        128usize,
-        "Size of rte_mempool_ops",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_mempool_ops>(),
-        64usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_mempool_ops"][::std::mem::size_of::<rte_mempool_ops>() - 128usize];
+    [
         "Alignment of rte_mempool_ops",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_mempool_ops>() - 64usize];
+    [
         "Offset of field: rte_mempool_ops::name",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).alloc) as usize - ptr as usize },
-        32usize,
+    ][::std::mem::offset_of!(rte_mempool_ops, name) - 0usize];
+    [
         "Offset of field: rte_mempool_ops::alloc",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).free) as usize - ptr as usize },
-        40usize,
+    ][::std::mem::offset_of!(rte_mempool_ops, alloc) - 32usize];
+    [
         "Offset of field: rte_mempool_ops::free",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).enqueue) as usize - ptr as usize },
-        48usize,
+    ][::std::mem::offset_of!(rte_mempool_ops, free) - 40usize];
+    [
         "Offset of field: rte_mempool_ops::enqueue",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dequeue) as usize - ptr as usize },
-        56usize,
+    ][::std::mem::offset_of!(rte_mempool_ops, enqueue) - 48usize];
+    [
         "Offset of field: rte_mempool_ops::dequeue",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).get_count) as usize - ptr as usize },
-        64usize,
+    ][::std::mem::offset_of!(rte_mempool_ops, dequeue) - 56usize];
+    [
         "Offset of field: rte_mempool_ops::get_count",
-    );
-}
+    ][::std::mem::offset_of!(rte_mempool_ops, get_count) - 64usize];
+};
 impl Default for rte_mempool_ops {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -115,13 +95,6 @@
         }
     }
 }
-impl ::std::cmp::PartialEq for rte_mempool_ops {
-    fn eq(&self, other: &rte_mempool_ops) -> bool {
-        self.name == other.name && self.alloc == other.alloc && self.free == other.free
-            && self.enqueue == other.enqueue && self.dequeue == other.dequeue
-            && self.get_count == other.get_count
-    }
-}
 /// The rte_spinlock_t type.
 #[repr(C)]
 #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
@@ -129,26 +102,14 @@
     ///< lock status 0 = unlocked, 1 = locked
     pub locked: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_rte_spinlock_t() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_spinlock_t> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_spinlock_t>(),
-        4usize,
-        "Size of rte_spinlock_t",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_spinlock_t>(),
-        4usize,
-        "Alignment of rte_spinlock_t",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).locked) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_spinlock_t"][::std::mem::size_of::<rte_spinlock_t>() - 4usize];
+    ["Alignment of rte_spinlock_t"][::std::mem::align_of::<rte_spinlock_t>() - 4usize];
+    [
         "Offset of field: rte_spinlock_t::locked",
-    );
-}
+    ][::std::mem::offset_of!(rte_spinlock_t, locked) - 0usize];
+};
 /** Structure storing the table of registered ops structs, each of which contain
  the function pointers for the mempool ops functions.
  Each process has its own storage for this ops struct array so that
@@ -158,7 +119,7 @@
  This results in us simply having "ops_index" in the mempool struct.*/
 #[repr(C)]
 #[repr(align(64))]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct rte_mempool_ops_table {
     ///< Spinlock for add/delete.
     pub sl: rte_spinlock_t,
@@ -168,36 +129,24 @@
     /// Storage for all possible ops structs.
     pub ops: [rte_mempool_ops; 16usize],
 }
-#[test]
-fn bindgen_test_layout_rte_mempool_ops_table() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_mempool_ops_table> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_mempool_ops_table>(),
-        2112usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_mempool_ops_table",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_mempool_ops_table>(),
-        64usize,
+    ][::std::mem::size_of::<rte_mempool_ops_table>() - 2112usize];
+    [
         "Alignment of rte_mempool_ops_table",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).sl) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_mempool_ops_table>() - 64usize];
+    [
         "Offset of field: rte_mempool_ops_table::sl",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).num_ops) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_mempool_ops_table, sl) - 0usize];
+    [
         "Offset of field: rte_mempool_ops_table::num_ops",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).ops) as usize - ptr as usize },
-        64usize,
+    ][::std::mem::offset_of!(rte_mempool_ops_table, num_ops) - 4usize];
+    [
         "Offset of field: rte_mempool_ops_table::ops",
-    );
-}
+    ][::std::mem::offset_of!(rte_mempool_ops_table, ops) - 64usize];
+};
 impl Default for rte_mempool_ops_table {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -210,7 +159,7 @@
 /// Structure to hold malloc heap
 #[repr(C)]
 #[repr(align(64))]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct malloc_heap {
     pub lock: rte_spinlock_t,
     pub free_head: [malloc_heap__bindgen_ty_1; 13usize],
@@ -222,26 +171,18 @@
 pub struct malloc_heap__bindgen_ty_1 {
     pub lh_first: *mut malloc_elem,
 }
-#[test]
-fn bindgen_test_layout_malloc_heap__bindgen_ty_1() {
-    const UNINIT: ::std::mem::MaybeUninit<malloc_heap__bindgen_ty_1> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<malloc_heap__bindgen_ty_1>(),
-        8usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of malloc_heap__bindgen_ty_1",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<malloc_heap__bindgen_ty_1>(),
-        8usize,
+    ][::std::mem::size_of::<malloc_heap__bindgen_ty_1>() - 8usize];
+    [
         "Alignment of malloc_heap__bindgen_ty_1",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).lh_first) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<malloc_heap__bindgen_ty_1>() - 8usize];
+    [
         "Offset of field: malloc_heap__bindgen_ty_1::lh_first",
-    );
-}
+    ][::std::mem::offset_of!(malloc_heap__bindgen_ty_1, lh_first) - 0usize];
+};
 impl Default for malloc_heap__bindgen_ty_1 {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -251,37 +192,23 @@
         }
     }
 }
-#[test]
-fn bindgen_test_layout_malloc_heap() {
-    const UNINIT: ::std::mem::MaybeUninit<malloc_heap> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<malloc_heap>(), 128usize, "Size of malloc_heap");
-    assert_eq!(
-        ::std::mem::align_of::<malloc_heap>(),
-        64usize,
-        "Alignment of malloc_heap",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).lock) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of malloc_heap"][::std::mem::size_of::<malloc_heap>() - 128usize];
+    ["Alignment of malloc_heap"][::std::mem::align_of::<malloc_heap>() - 64usize];
+    [
         "Offset of field: malloc_heap::lock",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).free_head) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(malloc_heap, lock) - 0usize];
+    [
         "Offset of field: malloc_heap::free_head",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).alloc_count) as usize - ptr as usize },
-        112usize,
+    ][::std::mem::offset_of!(malloc_heap, free_head) - 8usize];
+    [
         "Offset of field: malloc_heap::alloc_count",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).total_size) as usize - ptr as usize },
-        120usize,
+    ][::std::mem::offset_of!(malloc_heap, alloc_count) - 112usize];
+    [
         "Offset of field: malloc_heap::total_size",
-    );
-}
+    ][::std::mem::offset_of!(malloc_heap, total_size) - 120usize];
+};
 impl Default for malloc_heap {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -291,13 +218,6 @@
         }
     }
 }
-impl ::std::cmp::PartialEq for malloc_heap {
-    fn eq(&self, other: &malloc_heap) -> bool {
-        self.lock == other.lock && self.free_head == other.free_head
-            && self.alloc_count == other.alloc_count
-            && self.total_size == other.total_size
-    }
-}
 #[repr(C)]
 #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct malloc_elem {
diff --git a/bindgen-tests/tests/expectations/tests/layout_array_too_long.rs b/bindgen-tests/tests/expectations/tests/layout_array_too_long.rs
index d6ce288..315663e 100644
--- a/bindgen-tests/tests/expectations/tests/layout_array_too_long.rs
+++ b/bindgen-tests/tests/expectations/tests/layout_array_too_long.rs
@@ -27,28 +27,14 @@
     ///< fragment mbuf
     pub mb: *mut rte_mbuf,
 }
-#[test]
-fn bindgen_test_layout_ip_frag() {
-    const UNINIT: ::std::mem::MaybeUninit<ip_frag> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<ip_frag>(), 16usize, "Size of ip_frag");
-    assert_eq!(::std::mem::align_of::<ip_frag>(), 8usize, "Alignment of ip_frag");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).ofs) as usize - ptr as usize },
-        0usize,
-        "Offset of field: ip_frag::ofs",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
-        2usize,
-        "Offset of field: ip_frag::len",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).mb) as usize - ptr as usize },
-        8usize,
-        "Offset of field: ip_frag::mb",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of ip_frag"][::std::mem::size_of::<ip_frag>() - 16usize];
+    ["Alignment of ip_frag"][::std::mem::align_of::<ip_frag>() - 8usize];
+    ["Offset of field: ip_frag::ofs"][::std::mem::offset_of!(ip_frag, ofs) - 0usize];
+    ["Offset of field: ip_frag::len"][::std::mem::offset_of!(ip_frag, len) - 2usize];
+    ["Offset of field: ip_frag::mb"][::std::mem::offset_of!(ip_frag, mb) - 8usize];
+};
 impl Default for ip_frag {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -69,37 +55,25 @@
     ///< src/dst key length
     pub key_len: u32,
 }
-#[test]
-fn bindgen_test_layout_ip_frag_key() {
-    const UNINIT: ::std::mem::MaybeUninit<ip_frag_key> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<ip_frag_key>(), 40usize, "Size of ip_frag_key");
-    assert_eq!(
-        ::std::mem::align_of::<ip_frag_key>(),
-        8usize,
-        "Alignment of ip_frag_key",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).src_dst) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of ip_frag_key"][::std::mem::size_of::<ip_frag_key>() - 40usize];
+    ["Alignment of ip_frag_key"][::std::mem::align_of::<ip_frag_key>() - 8usize];
+    [
         "Offset of field: ip_frag_key::src_dst",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
-        32usize,
+    ][::std::mem::offset_of!(ip_frag_key, src_dst) - 0usize];
+    [
         "Offset of field: ip_frag_key::id",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).key_len) as usize - ptr as usize },
-        36usize,
+    ][::std::mem::offset_of!(ip_frag_key, id) - 32usize];
+    [
         "Offset of field: ip_frag_key::key_len",
-    );
-}
+    ][::std::mem::offset_of!(ip_frag_key, key_len) - 36usize];
+};
 /** @internal Fragmented packet to reassemble.
  First two entries in the frags[] array are for the last and first fragments.*/
 #[repr(C)]
 #[repr(align(64))]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct ip_frag_pkt {
     ///< LRU list
     pub lru: ip_frag_pkt__bindgen_ty_1,
@@ -122,31 +96,21 @@
     pub tqe_next: *mut ip_frag_pkt,
     pub tqe_prev: *mut *mut ip_frag_pkt,
 }
-#[test]
-fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() {
-    const UNINIT: ::std::mem::MaybeUninit<ip_frag_pkt__bindgen_ty_1> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<ip_frag_pkt__bindgen_ty_1>(),
-        16usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of ip_frag_pkt__bindgen_ty_1",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<ip_frag_pkt__bindgen_ty_1>(),
-        8usize,
+    ][::std::mem::size_of::<ip_frag_pkt__bindgen_ty_1>() - 16usize];
+    [
         "Alignment of ip_frag_pkt__bindgen_ty_1",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<ip_frag_pkt__bindgen_ty_1>() - 8usize];
+    [
         "Offset of field: ip_frag_pkt__bindgen_ty_1::tqe_next",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(ip_frag_pkt__bindgen_ty_1, tqe_next) - 0usize];
+    [
         "Offset of field: ip_frag_pkt__bindgen_ty_1::tqe_prev",
-    );
-}
+    ][::std::mem::offset_of!(ip_frag_pkt__bindgen_ty_1, tqe_prev) - 8usize];
+};
 impl Default for ip_frag_pkt__bindgen_ty_1 {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -156,52 +120,32 @@
         }
     }
 }
-#[test]
-fn bindgen_test_layout_ip_frag_pkt() {
-    const UNINIT: ::std::mem::MaybeUninit<ip_frag_pkt> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<ip_frag_pkt>(), 192usize, "Size of ip_frag_pkt");
-    assert_eq!(
-        ::std::mem::align_of::<ip_frag_pkt>(),
-        64usize,
-        "Alignment of ip_frag_pkt",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).lru) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of ip_frag_pkt"][::std::mem::size_of::<ip_frag_pkt>() - 192usize];
+    ["Alignment of ip_frag_pkt"][::std::mem::align_of::<ip_frag_pkt>() - 64usize];
+    [
         "Offset of field: ip_frag_pkt::lru",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, lru) - 0usize];
+    [
         "Offset of field: ip_frag_pkt::key",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize },
-        56usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, key) - 16usize];
+    [
         "Offset of field: ip_frag_pkt::start",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).total_size) as usize - ptr as usize },
-        64usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, start) - 56usize];
+    [
         "Offset of field: ip_frag_pkt::total_size",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).frag_size) as usize - ptr as usize },
-        68usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, total_size) - 64usize];
+    [
         "Offset of field: ip_frag_pkt::frag_size",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).last_idx) as usize - ptr as usize },
-        72usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, frag_size) - 68usize];
+    [
         "Offset of field: ip_frag_pkt::last_idx",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).frags) as usize - ptr as usize },
-        80usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, last_idx) - 72usize];
+    [
         "Offset of field: ip_frag_pkt::frags",
-    );
-}
+    ][::std::mem::offset_of!(ip_frag_pkt, frags) - 80usize];
+};
 impl Default for ip_frag_pkt {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -211,13 +155,6 @@
         }
     }
 }
-impl ::std::cmp::PartialEq for ip_frag_pkt {
-    fn eq(&self, other: &ip_frag_pkt) -> bool {
-        self.lru == other.lru && self.key == other.key && self.start == other.start
-            && self.total_size == other.total_size && self.frag_size == other.frag_size
-            && self.last_idx == other.last_idx && self.frags == other.frags
-    }
-}
 ///< fragment mbuf
 #[repr(C)]
 #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
diff --git a/bindgen-tests/tests/expectations/tests/layout_eth_conf.rs b/bindgen-tests/tests/expectations/tests/layout_eth_conf.rs
index 2686d8f..7d975cd 100644
--- a/bindgen-tests/tests/expectations/tests/layout_eth_conf.rs
+++ b/bindgen-tests/tests/expectations/tests/layout_eth_conf.rs
@@ -32,6 +32,16 @@
         Self::extract_bit(byte, index)
     }
     #[inline]
+    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+        let byte_index = index / 8;
+        let byte = unsafe {
+            *(core::ptr::addr_of!((*this).storage) as *const u8)
+                .offset(byte_index as isize)
+        };
+        Self::extract_bit(byte, index)
+    }
+    #[inline]
     fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
         let bit_index = if cfg!(target_endian = "big") {
             7 - (index % 8)
@@ -49,6 +59,16 @@
         *byte = Self::change_bit(*byte, index, val);
     }
     #[inline]
+    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+        let byte_index = index / 8;
+        let byte = unsafe {
+            (core::ptr::addr_of_mut!((*this).storage) as *mut u8)
+                .offset(byte_index as isize)
+        };
+        unsafe { *byte = Self::change_bit(*byte, index, val) };
+    }
+    #[inline]
     pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -69,6 +89,26 @@
         val
     }
     #[inline]
+    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),
+        );
+        let mut val = 0;
+        for i in 0..(bit_width as usize) {
+            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
+                let index = if cfg!(target_endian = "big") {
+                    bit_width as usize - 1 - i
+                } else {
+                    i
+                };
+                val |= 1 << index;
+            }
+        }
+        val
+    }
+    #[inline]
     pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -86,6 +126,24 @@
             self.set_bit(index + bit_offset, val_bit_is_set);
         }
     }
+    #[inline]
+    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),
+        );
+        for i in 0..(bit_width as usize) {
+            let mask = 1 << i;
+            let val_bit_is_set = val & mask == mask;
+            let index = if cfg!(target_endian = "big") {
+                bit_width as usize - 1 - i
+            } else {
+                i
+            };
+            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
+        }
+    }
 }
 pub const ETH_MQ_RX_RSS_FLAG: u32 = 1;
 pub const ETH_MQ_RX_DCB_FLAG: u32 = 2;
@@ -153,36 +211,20 @@
     pub split_hdr_size: u16,
     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_rxmode() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_rxmode> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_rxmode>(),
-        12usize,
-        "Size of rte_eth_rxmode",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_rxmode>(),
-        4usize,
-        "Alignment of rte_eth_rxmode",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).mq_mode) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_eth_rxmode"][::std::mem::size_of::<rte_eth_rxmode>() - 12usize];
+    ["Alignment of rte_eth_rxmode"][::std::mem::align_of::<rte_eth_rxmode>() - 4usize];
+    [
         "Offset of field: rte_eth_rxmode::mq_mode",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).max_rx_pkt_len) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_rxmode, mq_mode) - 0usize];
+    [
         "Offset of field: rte_eth_rxmode::max_rx_pkt_len",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).split_hdr_size) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(rte_eth_rxmode, max_rx_pkt_len) - 4usize];
+    [
         "Offset of field: rte_eth_rxmode::split_hdr_size",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_rxmode, split_hdr_size) - 8usize];
+};
 impl Default for rte_eth_rxmode {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -205,6 +247,31 @@
         }
     }
     #[inline]
+    pub unsafe fn header_split_raw(this: *const Self) -> u16 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 2usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 0usize, 1u8)
+                    as u16,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_header_split_raw(this: *mut Self, val: u16) {
+        unsafe {
+            let val: u16 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 2usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                0usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn hw_ip_checksum(&self) -> u16 {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) }
     }
@@ -216,6 +283,31 @@
         }
     }
     #[inline]
+    pub unsafe fn hw_ip_checksum_raw(this: *const Self) -> u16 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 2usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 1usize, 1u8)
+                    as u16,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_hw_ip_checksum_raw(this: *mut Self, val: u16) {
+        unsafe {
+            let val: u16 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 2usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                1usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn hw_vlan_filter(&self) -> u16 {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) }
     }
@@ -227,6 +319,31 @@
         }
     }
     #[inline]
+    pub unsafe fn hw_vlan_filter_raw(this: *const Self) -> u16 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 2usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 2usize, 1u8)
+                    as u16,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_hw_vlan_filter_raw(this: *mut Self, val: u16) {
+        unsafe {
+            let val: u16 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 2usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                2usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn hw_vlan_strip(&self) -> u16 {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) }
     }
@@ -238,6 +355,31 @@
         }
     }
     #[inline]
+    pub unsafe fn hw_vlan_strip_raw(this: *const Self) -> u16 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 2usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 3usize, 1u8)
+                    as u16,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_hw_vlan_strip_raw(this: *mut Self, val: u16) {
+        unsafe {
+            let val: u16 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 2usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                3usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn hw_vlan_extend(&self) -> u16 {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) }
     }
@@ -249,6 +391,31 @@
         }
     }
     #[inline]
+    pub unsafe fn hw_vlan_extend_raw(this: *const Self) -> u16 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 2usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 4usize, 1u8)
+                    as u16,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_hw_vlan_extend_raw(this: *mut Self, val: u16) {
+        unsafe {
+            let val: u16 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 2usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                4usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn jumbo_frame(&self) -> u16 {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) }
     }
@@ -260,6 +427,31 @@
         }
     }
     #[inline]
+    pub unsafe fn jumbo_frame_raw(this: *const Self) -> u16 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 2usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 5usize, 1u8)
+                    as u16,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_jumbo_frame_raw(this: *mut Self, val: u16) {
+        unsafe {
+            let val: u16 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 2usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                5usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn hw_strip_crc(&self) -> u16 {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) }
     }
@@ -271,6 +463,31 @@
         }
     }
     #[inline]
+    pub unsafe fn hw_strip_crc_raw(this: *const Self) -> u16 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 2usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 6usize, 1u8)
+                    as u16,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_hw_strip_crc_raw(this: *mut Self, val: u16) {
+        unsafe {
+            let val: u16 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 2usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                6usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn enable_scatter(&self) -> u16 {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) }
     }
@@ -282,6 +499,31 @@
         }
     }
     #[inline]
+    pub unsafe fn enable_scatter_raw(this: *const Self) -> u16 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 2usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 7usize, 1u8)
+                    as u16,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_enable_scatter_raw(this: *mut Self, val: u16) {
+        unsafe {
+            let val: u16 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 2usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                7usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn enable_lro(&self) -> u16 {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
     }
@@ -293,6 +535,31 @@
         }
     }
     #[inline]
+    pub unsafe fn enable_lro_raw(this: *const Self) -> u16 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 2usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 8usize, 1u8)
+                    as u16,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_enable_lro_raw(this: *mut Self, val: u16) {
+        unsafe {
+            let val: u16 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 2usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                8usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn new_bitfield_1(
         header_split: u16,
         hw_ip_checksum: u16,
@@ -427,31 +694,17 @@
     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
     pub __bindgen_padding_0: u8,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_txmode() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_txmode> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_txmode>(),
-        8usize,
-        "Size of rte_eth_txmode",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_txmode>(),
-        4usize,
-        "Alignment of rte_eth_txmode",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).mq_mode) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_eth_txmode"][::std::mem::size_of::<rte_eth_txmode>() - 8usize];
+    ["Alignment of rte_eth_txmode"][::std::mem::align_of::<rte_eth_txmode>() - 4usize];
+    [
         "Offset of field: rte_eth_txmode::mq_mode",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pvid) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_txmode, mq_mode) - 0usize];
+    [
         "Offset of field: rte_eth_txmode::pvid",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_txmode, pvid) - 4usize];
+};
 impl Default for rte_eth_txmode {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -474,6 +727,30 @@
         }
     }
     #[inline]
+    pub unsafe fn hw_vlan_reject_tagged_raw(this: *const Self) -> u8 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 1usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 0usize, 1u8) as u8,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_hw_vlan_reject_tagged_raw(this: *mut Self, val: u8) {
+        unsafe {
+            let val: u8 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 1usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                0usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn hw_vlan_reject_untagged(&self) -> u8 {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
     }
@@ -485,6 +762,30 @@
         }
     }
     #[inline]
+    pub unsafe fn hw_vlan_reject_untagged_raw(this: *const Self) -> u8 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 1usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 1usize, 1u8) as u8,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_hw_vlan_reject_untagged_raw(this: *mut Self, val: u8) {
+        unsafe {
+            let val: u8 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 1usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                1usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn hw_vlan_insert_pvid(&self) -> u8 {
         unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
     }
@@ -496,6 +797,30 @@
         }
     }
     #[inline]
+    pub unsafe fn hw_vlan_insert_pvid_raw(this: *const Self) -> u8 {
+        unsafe {
+            ::std::mem::transmute(
+                <__BindgenBitfieldUnit<
+                    [u8; 1usize],
+                >>::raw_get(::std::ptr::addr_of!((*this)._bitfield_1), 2usize, 1u8) as u8,
+            )
+        }
+    }
+    #[inline]
+    pub unsafe fn set_hw_vlan_insert_pvid_raw(this: *mut Self, val: u8) {
+        unsafe {
+            let val: u8 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<
+                [u8; 1usize],
+            >>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                2usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn new_bitfield_1(
         hw_vlan_reject_tagged: u8,
         hw_vlan_reject_untagged: u8,
@@ -563,36 +888,22 @@
     ///< Hash functions to apply - see below.
     pub rss_hf: u64,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_rss_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_rss_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_rss_conf>(),
-        24usize,
-        "Size of rte_eth_rss_conf",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_rss_conf>(),
-        8usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_eth_rss_conf"][::std::mem::size_of::<rte_eth_rss_conf>() - 24usize];
+    [
         "Alignment of rte_eth_rss_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).rss_key) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_rss_conf>() - 8usize];
+    [
         "Offset of field: rte_eth_rss_conf::rss_key",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).rss_key_len) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(rte_eth_rss_conf, rss_key) - 0usize];
+    [
         "Offset of field: rte_eth_rss_conf::rss_key_len",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).rss_hf) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(rte_eth_rss_conf, rss_key_len) - 8usize];
+    [
         "Offset of field: rte_eth_rss_conf::rss_hf",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_rss_conf, rss_hf) - 16usize];
+};
 impl Default for rte_eth_rss_conf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -636,7 +947,7 @@
  A default pool may be used, if desired, to route all traffic which
  does not match the vlan filter rules.*/
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct rte_eth_vmdq_dcb_conf {
     ///< With DCB, 16 or 32 pools
     pub nb_queue_pools: rte_eth_nb_pools,
@@ -658,78 +969,48 @@
     ///< Bitmask of pools for packet rx
     pub pools: u64,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_vmdq_dcb_conf__bindgen_ty_1> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>(),
-        16usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_vmdq_dcb_conf__bindgen_ty_1",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>(),
-        8usize,
+    ][::std::mem::size_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>() - 16usize];
+    [
         "Alignment of rte_eth_vmdq_dcb_conf__bindgen_ty_1",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).vlan_id) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>() - 8usize];
+    [
         "Offset of field: rte_eth_vmdq_dcb_conf__bindgen_ty_1::vlan_id",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pools) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf__bindgen_ty_1, vlan_id) - 0usize];
+    [
         "Offset of field: rte_eth_vmdq_dcb_conf__bindgen_ty_1::pools",
-    );
-}
-#[test]
-fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_vmdq_dcb_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_vmdq_dcb_conf>(),
-        1040usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf__bindgen_ty_1, pools) - 8usize];
+};
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_vmdq_dcb_conf",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_vmdq_dcb_conf>(),
-        8usize,
+    ][::std::mem::size_of::<rte_eth_vmdq_dcb_conf>() - 1040usize];
+    [
         "Alignment of rte_eth_vmdq_dcb_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_queue_pools) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_vmdq_dcb_conf>() - 8usize];
+    [
         "Offset of field: rte_eth_vmdq_dcb_conf::nb_queue_pools",
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).enable_default_pool) as usize - ptr as usize
-        },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, nb_queue_pools) - 0usize];
+    [
         "Offset of field: rte_eth_vmdq_dcb_conf::enable_default_pool",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).default_pool) as usize - ptr as usize },
-        5usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, enable_default_pool) - 4usize];
+    [
         "Offset of field: rte_eth_vmdq_dcb_conf::default_pool",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_pool_maps) as usize - ptr as usize },
-        6usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, default_pool) - 5usize];
+    [
         "Offset of field: rte_eth_vmdq_dcb_conf::nb_pool_maps",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pool_map) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, nb_pool_maps) - 6usize];
+    [
         "Offset of field: rte_eth_vmdq_dcb_conf::pool_map",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dcb_tc) as usize - ptr as usize },
-        1032usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, pool_map) - 8usize];
+    [
         "Offset of field: rte_eth_vmdq_dcb_conf::dcb_tc",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, dcb_tc) - 1032usize];
+};
 impl Default for rte_eth_vmdq_dcb_conf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -747,31 +1028,21 @@
     /// Traffic class each UP mapped to.
     pub dcb_tc: [u8; 8usize],
 }
-#[test]
-fn bindgen_test_layout_rte_eth_dcb_rx_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_dcb_rx_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_dcb_rx_conf>(),
-        12usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_dcb_rx_conf",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_dcb_rx_conf>(),
-        4usize,
+    ][::std::mem::size_of::<rte_eth_dcb_rx_conf>() - 12usize];
+    [
         "Alignment of rte_eth_dcb_rx_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_tcs) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_dcb_rx_conf>() - 4usize];
+    [
         "Offset of field: rte_eth_dcb_rx_conf::nb_tcs",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dcb_tc) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_dcb_rx_conf, nb_tcs) - 0usize];
+    [
         "Offset of field: rte_eth_dcb_rx_conf::dcb_tc",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_dcb_rx_conf, dcb_tc) - 4usize];
+};
 impl Default for rte_eth_dcb_rx_conf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -789,31 +1060,21 @@
     /// Traffic class each UP mapped to.
     pub dcb_tc: [u8; 8usize],
 }
-#[test]
-fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_vmdq_dcb_tx_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_vmdq_dcb_tx_conf>(),
-        12usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_vmdq_dcb_tx_conf",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_vmdq_dcb_tx_conf>(),
-        4usize,
+    ][::std::mem::size_of::<rte_eth_vmdq_dcb_tx_conf>() - 12usize];
+    [
         "Alignment of rte_eth_vmdq_dcb_tx_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_queue_pools) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_vmdq_dcb_tx_conf>() - 4usize];
+    [
         "Offset of field: rte_eth_vmdq_dcb_tx_conf::nb_queue_pools",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dcb_tc) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_dcb_tx_conf, nb_queue_pools) - 0usize];
+    [
         "Offset of field: rte_eth_vmdq_dcb_tx_conf::dcb_tc",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_vmdq_dcb_tx_conf, dcb_tc) - 4usize];
+};
 impl Default for rte_eth_vmdq_dcb_tx_conf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -831,31 +1092,21 @@
     /// Traffic class each UP mapped to.
     pub dcb_tc: [u8; 8usize],
 }
-#[test]
-fn bindgen_test_layout_rte_eth_dcb_tx_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_dcb_tx_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_dcb_tx_conf>(),
-        12usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_dcb_tx_conf",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_dcb_tx_conf>(),
-        4usize,
+    ][::std::mem::size_of::<rte_eth_dcb_tx_conf>() - 12usize];
+    [
         "Alignment of rte_eth_dcb_tx_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_tcs) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_dcb_tx_conf>() - 4usize];
+    [
         "Offset of field: rte_eth_dcb_tx_conf::nb_tcs",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dcb_tc) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_dcb_tx_conf, nb_tcs) - 0usize];
+    [
         "Offset of field: rte_eth_dcb_tx_conf::dcb_tc",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_dcb_tx_conf, dcb_tc) - 4usize];
+};
 impl Default for rte_eth_dcb_tx_conf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -871,26 +1122,18 @@
     ///< VMDq mode, 64 pools.
     pub nb_queue_pools: rte_eth_nb_pools,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_vmdq_tx_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_vmdq_tx_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_vmdq_tx_conf>(),
-        4usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_vmdq_tx_conf",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_vmdq_tx_conf>(),
-        4usize,
+    ][::std::mem::size_of::<rte_eth_vmdq_tx_conf>() - 4usize];
+    [
         "Alignment of rte_eth_vmdq_tx_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_queue_pools) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_vmdq_tx_conf>() - 4usize];
+    [
         "Offset of field: rte_eth_vmdq_tx_conf::nb_queue_pools",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_vmdq_tx_conf, nb_queue_pools) - 0usize];
+};
 impl Default for rte_eth_vmdq_tx_conf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -901,7 +1144,7 @@
     }
 }
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct rte_eth_vmdq_rx_conf {
     ///< VMDq only mode, 8 or 64 pools
     pub nb_queue_pools: rte_eth_nb_pools,
@@ -926,83 +1169,51 @@
     ///< Bitmask of pools for packet rx
     pub pools: u64,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_vmdq_rx_conf__bindgen_ty_1> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>(),
-        16usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_vmdq_rx_conf__bindgen_ty_1",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>(),
-        8usize,
+    ][::std::mem::size_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>() - 16usize];
+    [
         "Alignment of rte_eth_vmdq_rx_conf__bindgen_ty_1",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).vlan_id) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>() - 8usize];
+    [
         "Offset of field: rte_eth_vmdq_rx_conf__bindgen_ty_1::vlan_id",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pools) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf__bindgen_ty_1, vlan_id) - 0usize];
+    [
         "Offset of field: rte_eth_vmdq_rx_conf__bindgen_ty_1::pools",
-    );
-}
-#[test]
-fn bindgen_test_layout_rte_eth_vmdq_rx_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_vmdq_rx_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_vmdq_rx_conf>(),
-        1040usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf__bindgen_ty_1, pools) - 8usize];
+};
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_vmdq_rx_conf",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_vmdq_rx_conf>(),
-        8usize,
+    ][::std::mem::size_of::<rte_eth_vmdq_rx_conf>() - 1040usize];
+    [
         "Alignment of rte_eth_vmdq_rx_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_queue_pools) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_vmdq_rx_conf>() - 8usize];
+    [
         "Offset of field: rte_eth_vmdq_rx_conf::nb_queue_pools",
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).enable_default_pool) as usize - ptr as usize
-        },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, nb_queue_pools) - 0usize];
+    [
         "Offset of field: rte_eth_vmdq_rx_conf::enable_default_pool",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).default_pool) as usize - ptr as usize },
-        5usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, enable_default_pool) - 4usize];
+    [
         "Offset of field: rte_eth_vmdq_rx_conf::default_pool",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).enable_loop_back) as usize - ptr as usize },
-        6usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, default_pool) - 5usize];
+    [
         "Offset of field: rte_eth_vmdq_rx_conf::enable_loop_back",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_pool_maps) as usize - ptr as usize },
-        7usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, enable_loop_back) - 6usize];
+    [
         "Offset of field: rte_eth_vmdq_rx_conf::nb_pool_maps",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).rx_mode) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, nb_pool_maps) - 7usize];
+    [
         "Offset of field: rte_eth_vmdq_rx_conf::rx_mode",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pool_map) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, rx_mode) - 8usize];
+    [
         "Offset of field: rte_eth_vmdq_rx_conf::pool_map",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, pool_map) - 16usize];
+};
 impl Default for rte_eth_vmdq_rx_conf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -1065,46 +1276,28 @@
     ///< Protocol, next header in big endian.
     pub proto: u8,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_ipv4_flow() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_ipv4_flow> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_ipv4_flow>(),
-        12usize,
-        "Size of rte_eth_ipv4_flow",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_ipv4_flow>(),
-        4usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_eth_ipv4_flow"][::std::mem::size_of::<rte_eth_ipv4_flow>() - 12usize];
+    [
         "Alignment of rte_eth_ipv4_flow",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).src_ip) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_ipv4_flow>() - 4usize];
+    [
         "Offset of field: rte_eth_ipv4_flow::src_ip",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dst_ip) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_ipv4_flow, src_ip) - 0usize];
+    [
         "Offset of field: rte_eth_ipv4_flow::dst_ip",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tos) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(rte_eth_ipv4_flow, dst_ip) - 4usize];
+    [
         "Offset of field: rte_eth_ipv4_flow::tos",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).ttl) as usize - ptr as usize },
-        9usize,
+    ][::std::mem::offset_of!(rte_eth_ipv4_flow, tos) - 8usize];
+    [
         "Offset of field: rte_eth_ipv4_flow::ttl",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize },
-        10usize,
+    ][::std::mem::offset_of!(rte_eth_ipv4_flow, ttl) - 9usize];
+    [
         "Offset of field: rte_eth_ipv4_flow::proto",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_ipv4_flow, proto) - 10usize];
+};
 /// A structure used to define the input for IPV6 flow
 #[repr(C)]
 #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
@@ -1120,46 +1313,28 @@
     ///< Hop limits to match.
     pub hop_limits: u8,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_ipv6_flow() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_ipv6_flow> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_ipv6_flow>(),
-        36usize,
-        "Size of rte_eth_ipv6_flow",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_ipv6_flow>(),
-        4usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_eth_ipv6_flow"][::std::mem::size_of::<rte_eth_ipv6_flow>() - 36usize];
+    [
         "Alignment of rte_eth_ipv6_flow",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).src_ip) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_ipv6_flow>() - 4usize];
+    [
         "Offset of field: rte_eth_ipv6_flow::src_ip",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dst_ip) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(rte_eth_ipv6_flow, src_ip) - 0usize];
+    [
         "Offset of field: rte_eth_ipv6_flow::dst_ip",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tc) as usize - ptr as usize },
-        32usize,
+    ][::std::mem::offset_of!(rte_eth_ipv6_flow, dst_ip) - 16usize];
+    [
         "Offset of field: rte_eth_ipv6_flow::tc",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).proto) as usize - ptr as usize },
-        33usize,
+    ][::std::mem::offset_of!(rte_eth_ipv6_flow, tc) - 32usize];
+    [
         "Offset of field: rte_eth_ipv6_flow::proto",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).hop_limits) as usize - ptr as usize },
-        34usize,
+    ][::std::mem::offset_of!(rte_eth_ipv6_flow, proto) - 33usize];
+    [
         "Offset of field: rte_eth_ipv6_flow::hop_limits",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_ipv6_flow, hop_limits) - 34usize];
+};
 /**  A structure used to configure FDIR masks that are used by the device
   to match the various fields of RX packet headers.*/
 #[repr(C)]
@@ -1184,63 +1359,39 @@
 0 - Ignore tunnel type.*/
     pub tunnel_type_mask: u8,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_fdir_masks() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_fdir_masks> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_fdir_masks>(),
-        68usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_fdir_masks",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_fdir_masks>(),
-        4usize,
+    ][::std::mem::size_of::<rte_eth_fdir_masks>() - 68usize];
+    [
         "Alignment of rte_eth_fdir_masks",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).vlan_tci_mask) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_fdir_masks>() - 4usize];
+    [
         "Offset of field: rte_eth_fdir_masks::vlan_tci_mask",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).ipv4_mask) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_masks, vlan_tci_mask) - 0usize];
+    [
         "Offset of field: rte_eth_fdir_masks::ipv4_mask",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).ipv6_mask) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_masks, ipv4_mask) - 4usize];
+    [
         "Offset of field: rte_eth_fdir_masks::ipv6_mask",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).src_port_mask) as usize - ptr as usize },
-        52usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_masks, ipv6_mask) - 16usize];
+    [
         "Offset of field: rte_eth_fdir_masks::src_port_mask",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dst_port_mask) as usize - ptr as usize },
-        54usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_masks, src_port_mask) - 52usize];
+    [
         "Offset of field: rte_eth_fdir_masks::dst_port_mask",
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).mac_addr_byte_mask) as usize - ptr as usize
-        },
-        56usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_masks, dst_port_mask) - 54usize];
+    [
         "Offset of field: rte_eth_fdir_masks::mac_addr_byte_mask",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tunnel_id_mask) as usize - ptr as usize },
-        60usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_masks, mac_addr_byte_mask) - 56usize];
+    [
         "Offset of field: rte_eth_fdir_masks::tunnel_id_mask",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tunnel_type_mask) as usize - ptr as usize },
-        64usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_masks, tunnel_id_mask) - 60usize];
+    [
         "Offset of field: rte_eth_fdir_masks::tunnel_type_mask",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_fdir_masks, tunnel_type_mask) - 64usize];
+};
 #[repr(u32)]
 /// Payload type
 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -1261,31 +1412,21 @@
     pub type_: rte_eth_payload_type,
     pub src_offset: [u16; 16usize],
 }
-#[test]
-fn bindgen_test_layout_rte_eth_flex_payload_cfg() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_flex_payload_cfg> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_flex_payload_cfg>(),
-        36usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_flex_payload_cfg",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_flex_payload_cfg>(),
-        4usize,
+    ][::std::mem::size_of::<rte_eth_flex_payload_cfg>() - 36usize];
+    [
         "Alignment of rte_eth_flex_payload_cfg",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_flex_payload_cfg>() - 4usize];
+    [
         "Offset of field: rte_eth_flex_payload_cfg::type_",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).src_offset) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_flex_payload_cfg, type_) - 0usize];
+    [
         "Offset of field: rte_eth_flex_payload_cfg::src_offset",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_flex_payload_cfg, src_offset) - 4usize];
+};
 impl Default for rte_eth_flex_payload_cfg {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -1303,31 +1444,21 @@
     pub flow_type: u16,
     pub mask: [u8; 16usize],
 }
-#[test]
-fn bindgen_test_layout_rte_eth_fdir_flex_mask() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_fdir_flex_mask> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_fdir_flex_mask>(),
-        18usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_fdir_flex_mask",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_fdir_flex_mask>(),
-        2usize,
+    ][::std::mem::size_of::<rte_eth_fdir_flex_mask>() - 18usize];
+    [
         "Alignment of rte_eth_fdir_flex_mask",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).flow_type) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_fdir_flex_mask>() - 2usize];
+    [
         "Offset of field: rte_eth_fdir_flex_mask::flow_type",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize },
-        2usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_flex_mask, flow_type) - 0usize];
+    [
         "Offset of field: rte_eth_fdir_flex_mask::mask",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_fdir_flex_mask, mask) - 2usize];
+};
 /** A structure used to define all flexible payload related setting
  include flex payload and flex mask*/
 #[repr(C)]
@@ -1340,41 +1471,27 @@
     pub flex_set: [rte_eth_flex_payload_cfg; 8usize],
     pub flex_mask: [rte_eth_fdir_flex_mask; 22usize],
 }
-#[test]
-fn bindgen_test_layout_rte_eth_fdir_flex_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_fdir_flex_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_fdir_flex_conf>(),
-        688usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_fdir_flex_conf",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_fdir_flex_conf>(),
-        4usize,
+    ][::std::mem::size_of::<rte_eth_fdir_flex_conf>() - 688usize];
+    [
         "Alignment of rte_eth_fdir_flex_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_payloads) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_fdir_flex_conf>() - 4usize];
+    [
         "Offset of field: rte_eth_fdir_flex_conf::nb_payloads",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_flexmasks) as usize - ptr as usize },
-        2usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_flex_conf, nb_payloads) - 0usize];
+    [
         "Offset of field: rte_eth_fdir_flex_conf::nb_flexmasks",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).flex_set) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_flex_conf, nb_flexmasks) - 2usize];
+    [
         "Offset of field: rte_eth_fdir_flex_conf::flex_set",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).flex_mask) as usize - ptr as usize },
-        292usize,
+    ][::std::mem::offset_of!(rte_eth_fdir_flex_conf, flex_set) - 4usize];
+    [
         "Offset of field: rte_eth_fdir_flex_conf::flex_mask",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_fdir_flex_conf, flex_mask) - 292usize];
+};
 impl Default for rte_eth_fdir_flex_conf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -1402,51 +1519,29 @@
     pub mask: rte_eth_fdir_masks,
     pub flex_conf: rte_eth_fdir_flex_conf,
 }
-#[test]
-fn bindgen_test_layout_rte_fdir_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_fdir_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_fdir_conf>(),
-        772usize,
-        "Size of rte_fdir_conf",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_fdir_conf>(),
-        4usize,
-        "Alignment of rte_fdir_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_fdir_conf"][::std::mem::size_of::<rte_fdir_conf>() - 772usize];
+    ["Alignment of rte_fdir_conf"][::std::mem::align_of::<rte_fdir_conf>() - 4usize];
+    [
         "Offset of field: rte_fdir_conf::mode",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pballoc) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_fdir_conf, mode) - 0usize];
+    [
         "Offset of field: rte_fdir_conf::pballoc",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).status) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(rte_fdir_conf, pballoc) - 4usize];
+    [
         "Offset of field: rte_fdir_conf::status",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).drop_queue) as usize - ptr as usize },
-        12usize,
+    ][::std::mem::offset_of!(rte_fdir_conf, status) - 8usize];
+    [
         "Offset of field: rte_fdir_conf::drop_queue",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(rte_fdir_conf, drop_queue) - 12usize];
+    [
         "Offset of field: rte_fdir_conf::mask",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).flex_conf) as usize - ptr as usize },
-        84usize,
+    ][::std::mem::offset_of!(rte_fdir_conf, mask) - 16usize];
+    [
         "Offset of field: rte_fdir_conf::flex_conf",
-    );
-}
+    ][::std::mem::offset_of!(rte_fdir_conf, flex_conf) - 84usize];
+};
 impl Default for rte_fdir_conf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -1465,27 +1560,17 @@
     /// enable/disable rxq interrupt. 0 (default) - disable, 1 enable
     pub rxq: u16,
 }
-#[test]
-fn bindgen_test_layout_rte_intr_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_intr_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<rte_intr_conf>(), 4usize, "Size of rte_intr_conf");
-    assert_eq!(
-        ::std::mem::align_of::<rte_intr_conf>(),
-        2usize,
-        "Alignment of rte_intr_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).lsc) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_intr_conf"][::std::mem::size_of::<rte_intr_conf>() - 4usize];
+    ["Alignment of rte_intr_conf"][::std::mem::align_of::<rte_intr_conf>() - 2usize];
+    [
         "Offset of field: rte_intr_conf::lsc",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).rxq) as usize - ptr as usize },
-        2usize,
+    ][::std::mem::offset_of!(rte_intr_conf, lsc) - 0usize];
+    [
         "Offset of field: rte_intr_conf::rxq",
-    );
-}
+    ][::std::mem::offset_of!(rte_intr_conf, rxq) - 2usize];
+};
 /** A structure used to configure an Ethernet port.
  Depending upon the RX multi-queue mode, extra advanced
  configuration settings may be needed.*/
@@ -1523,7 +1608,7 @@
     pub intr_conf: rte_intr_conf,
 }
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct rte_eth_conf__bindgen_ty_1 {
     ///< Port RSS configuration
     pub rss_conf: rte_eth_rss_conf,
@@ -1531,41 +1616,27 @@
     pub dcb_rx_conf: rte_eth_dcb_rx_conf,
     pub vmdq_rx_conf: rte_eth_vmdq_rx_conf,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_conf__bindgen_ty_1> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_conf__bindgen_ty_1>(),
-        2120usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_conf__bindgen_ty_1",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_conf__bindgen_ty_1>(),
-        8usize,
+    ][::std::mem::size_of::<rte_eth_conf__bindgen_ty_1>() - 2120usize];
+    [
         "Alignment of rte_eth_conf__bindgen_ty_1",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).rss_conf) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_conf__bindgen_ty_1>() - 8usize];
+    [
         "Offset of field: rte_eth_conf__bindgen_ty_1::rss_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).vmdq_dcb_conf) as usize - ptr as usize },
-        24usize,
+    ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_1, rss_conf) - 0usize];
+    [
         "Offset of field: rte_eth_conf__bindgen_ty_1::vmdq_dcb_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dcb_rx_conf) as usize - ptr as usize },
-        1064usize,
+    ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_1, vmdq_dcb_conf) - 24usize];
+    [
         "Offset of field: rte_eth_conf__bindgen_ty_1::dcb_rx_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).vmdq_rx_conf) as usize - ptr as usize },
-        1080usize,
+    ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_1, dcb_rx_conf) - 1064usize];
+    [
         "Offset of field: rte_eth_conf__bindgen_ty_1::vmdq_rx_conf",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_1, vmdq_rx_conf) - 1080usize];
+};
 impl Default for rte_eth_conf__bindgen_ty_1 {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -1582,36 +1653,24 @@
     pub dcb_tx_conf: rte_eth_dcb_tx_conf,
     pub vmdq_tx_conf: rte_eth_vmdq_tx_conf,
 }
-#[test]
-fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_conf__bindgen_ty_2> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_conf__bindgen_ty_2>(),
-        12usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of rte_eth_conf__bindgen_ty_2",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_conf__bindgen_ty_2>(),
-        4usize,
+    ][::std::mem::size_of::<rte_eth_conf__bindgen_ty_2>() - 12usize];
+    [
         "Alignment of rte_eth_conf__bindgen_ty_2",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).vmdq_dcb_tx_conf) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_eth_conf__bindgen_ty_2>() - 4usize];
+    [
         "Offset of field: rte_eth_conf__bindgen_ty_2::vmdq_dcb_tx_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dcb_tx_conf) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_2, vmdq_dcb_tx_conf) - 0usize];
+    [
         "Offset of field: rte_eth_conf__bindgen_ty_2::dcb_tx_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).vmdq_tx_conf) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_2, dcb_tx_conf) - 0usize];
+    [
         "Offset of field: rte_eth_conf__bindgen_ty_2::vmdq_tx_conf",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_2, vmdq_tx_conf) - 0usize];
+};
 impl Default for rte_eth_conf__bindgen_ty_2 {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -1621,64 +1680,38 @@
         }
     }
 }
-#[test]
-fn bindgen_test_layout_rte_eth_conf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_conf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<rte_eth_conf>(), 2944usize, "Size of rte_eth_conf");
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_conf>(),
-        8usize,
-        "Alignment of rte_eth_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).link_speeds) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_eth_conf"][::std::mem::size_of::<rte_eth_conf>() - 2944usize];
+    ["Alignment of rte_eth_conf"][::std::mem::align_of::<rte_eth_conf>() - 8usize];
+    [
         "Offset of field: rte_eth_conf::link_speeds",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).rxmode) as usize - ptr as usize },
-        4usize,
+    ][::std::mem::offset_of!(rte_eth_conf, link_speeds) - 0usize];
+    [
         "Offset of field: rte_eth_conf::rxmode",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).txmode) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(rte_eth_conf, rxmode) - 4usize];
+    [
         "Offset of field: rte_eth_conf::txmode",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).lpbk_mode) as usize - ptr as usize },
-        24usize,
+    ][::std::mem::offset_of!(rte_eth_conf, txmode) - 16usize];
+    [
         "Offset of field: rte_eth_conf::lpbk_mode",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).rx_adv_conf) as usize - ptr as usize },
-        32usize,
+    ][::std::mem::offset_of!(rte_eth_conf, lpbk_mode) - 24usize];
+    [
         "Offset of field: rte_eth_conf::rx_adv_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tx_adv_conf) as usize - ptr as usize },
-        2152usize,
+    ][::std::mem::offset_of!(rte_eth_conf, rx_adv_conf) - 32usize];
+    [
         "Offset of field: rte_eth_conf::tx_adv_conf",
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).dcb_capability_en) as usize - ptr as usize
-        },
-        2164usize,
+    ][::std::mem::offset_of!(rte_eth_conf, tx_adv_conf) - 2152usize];
+    [
         "Offset of field: rte_eth_conf::dcb_capability_en",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).fdir_conf) as usize - ptr as usize },
-        2168usize,
+    ][::std::mem::offset_of!(rte_eth_conf, dcb_capability_en) - 2164usize];
+    [
         "Offset of field: rte_eth_conf::fdir_conf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).intr_conf) as usize - ptr as usize },
-        2940usize,
+    ][::std::mem::offset_of!(rte_eth_conf, fdir_conf) - 2168usize];
+    [
         "Offset of field: rte_eth_conf::intr_conf",
-    );
-}
+    ][::std::mem::offset_of!(rte_eth_conf, intr_conf) - 2940usize];
+};
 impl Default for rte_eth_conf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
diff --git a/bindgen-tests/tests/expectations/tests/layout_kni_mbuf.rs b/bindgen-tests/tests/expectations/tests/layout_kni_mbuf.rs
index a9d779e..38f49fb 100644
--- a/bindgen-tests/tests/expectations/tests/layout_kni_mbuf.rs
+++ b/bindgen-tests/tests/expectations/tests/layout_kni_mbuf.rs
@@ -3,7 +3,7 @@
 pub const RTE_CACHE_LINE_SIZE: u32 = 64;
 #[repr(C)]
 #[repr(align(64))]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone)]
 pub struct rte_kni_mbuf {
     pub buf_addr: *mut ::std::os::raw::c_void,
     pub buf_physaddr: u64,
@@ -26,87 +26,53 @@
     pub pool: *mut ::std::os::raw::c_void,
     pub next: *mut ::std::os::raw::c_void,
 }
-#[test]
-fn bindgen_test_layout_rte_kni_mbuf() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_kni_mbuf> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<rte_kni_mbuf>(), 128usize, "Size of rte_kni_mbuf");
-    assert_eq!(
-        ::std::mem::align_of::<rte_kni_mbuf>(),
-        64usize,
-        "Alignment of rte_kni_mbuf",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).buf_addr) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_kni_mbuf"][::std::mem::size_of::<rte_kni_mbuf>() - 128usize];
+    ["Alignment of rte_kni_mbuf"][::std::mem::align_of::<rte_kni_mbuf>() - 64usize];
+    [
         "Offset of field: rte_kni_mbuf::buf_addr",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).buf_physaddr) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, buf_addr) - 0usize];
+    [
         "Offset of field: rte_kni_mbuf::buf_physaddr",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pad0) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, buf_physaddr) - 8usize];
+    [
         "Offset of field: rte_kni_mbuf::pad0",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).data_off) as usize - ptr as usize },
-        18usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, pad0) - 16usize];
+    [
         "Offset of field: rte_kni_mbuf::data_off",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pad1) as usize - ptr as usize },
-        20usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, data_off) - 18usize];
+    [
         "Offset of field: rte_kni_mbuf::pad1",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_segs) as usize - ptr as usize },
-        22usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, pad1) - 20usize];
+    [
         "Offset of field: rte_kni_mbuf::nb_segs",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pad4) as usize - ptr as usize },
-        23usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, nb_segs) - 22usize];
+    [
         "Offset of field: rte_kni_mbuf::pad4",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).ol_flags) as usize - ptr as usize },
-        24usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, pad4) - 23usize];
+    [
         "Offset of field: rte_kni_mbuf::ol_flags",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pad2) as usize - ptr as usize },
-        32usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, ol_flags) - 24usize];
+    [
         "Offset of field: rte_kni_mbuf::pad2",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pkt_len) as usize - ptr as usize },
-        36usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, pad2) - 32usize];
+    [
         "Offset of field: rte_kni_mbuf::pkt_len",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).data_len) as usize - ptr as usize },
-        40usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, pkt_len) - 36usize];
+    [
         "Offset of field: rte_kni_mbuf::data_len",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pad3) as usize - ptr as usize },
-        64usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, data_len) - 40usize];
+    [
         "Offset of field: rte_kni_mbuf::pad3",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pool) as usize - ptr as usize },
-        72usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, pad3) - 64usize];
+    [
         "Offset of field: rte_kni_mbuf::pool",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize },
-        80usize,
+    ][::std::mem::offset_of!(rte_kni_mbuf, pool) - 72usize];
+    [
         "Offset of field: rte_kni_mbuf::next",
-    );
-}
+    ][::std::mem::offset_of!(rte_kni_mbuf, next) - 80usize];
+};
 impl Default for rte_kni_mbuf {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
diff --git a/bindgen-tests/tests/expectations/tests/layout_large_align_field.rs b/bindgen-tests/tests/expectations/tests/layout_large_align_field.rs
index b72c221..3be68eb 100644
--- a/bindgen-tests/tests/expectations/tests/layout_large_align_field.rs
+++ b/bindgen-tests/tests/expectations/tests/layout_large_align_field.rs
@@ -57,28 +57,14 @@
     ///< fragment mbuf
     pub mb: *mut rte_mbuf,
 }
-#[test]
-fn bindgen_test_layout_ip_frag() {
-    const UNINIT: ::std::mem::MaybeUninit<ip_frag> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<ip_frag>(), 16usize, "Size of ip_frag");
-    assert_eq!(::std::mem::align_of::<ip_frag>(), 8usize, "Alignment of ip_frag");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).ofs) as usize - ptr as usize },
-        0usize,
-        "Offset of field: ip_frag::ofs",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
-        2usize,
-        "Offset of field: ip_frag::len",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).mb) as usize - ptr as usize },
-        8usize,
-        "Offset of field: ip_frag::mb",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of ip_frag"][::std::mem::size_of::<ip_frag>() - 16usize];
+    ["Alignment of ip_frag"][::std::mem::align_of::<ip_frag>() - 8usize];
+    ["Offset of field: ip_frag::ofs"][::std::mem::offset_of!(ip_frag, ofs) - 0usize];
+    ["Offset of field: ip_frag::len"][::std::mem::offset_of!(ip_frag, len) - 2usize];
+    ["Offset of field: ip_frag::mb"][::std::mem::offset_of!(ip_frag, mb) - 8usize];
+};
 impl Default for ip_frag {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -99,37 +85,25 @@
     ///< src/dst key length
     pub key_len: u32,
 }
-#[test]
-fn bindgen_test_layout_ip_frag_key() {
-    const UNINIT: ::std::mem::MaybeUninit<ip_frag_key> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<ip_frag_key>(), 40usize, "Size of ip_frag_key");
-    assert_eq!(
-        ::std::mem::align_of::<ip_frag_key>(),
-        8usize,
-        "Alignment of ip_frag_key",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).src_dst) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of ip_frag_key"][::std::mem::size_of::<ip_frag_key>() - 40usize];
+    ["Alignment of ip_frag_key"][::std::mem::align_of::<ip_frag_key>() - 8usize];
+    [
         "Offset of field: ip_frag_key::src_dst",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
-        32usize,
+    ][::std::mem::offset_of!(ip_frag_key, src_dst) - 0usize];
+    [
         "Offset of field: ip_frag_key::id",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).key_len) as usize - ptr as usize },
-        36usize,
+    ][::std::mem::offset_of!(ip_frag_key, id) - 32usize];
+    [
         "Offset of field: ip_frag_key::key_len",
-    );
-}
+    ][::std::mem::offset_of!(ip_frag_key, key_len) - 36usize];
+};
 /** @internal Fragmented packet to reassemble.
  First two entries in the frags[] array are for the last and first fragments.*/
 #[repr(C)]
 #[repr(align(64))]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone)]
 pub struct ip_frag_pkt {
     ///< LRU list
     pub lru: ip_frag_pkt__bindgen_ty_1,
@@ -152,31 +126,21 @@
     pub tqe_next: *mut ip_frag_pkt,
     pub tqe_prev: *mut *mut ip_frag_pkt,
 }
-#[test]
-fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() {
-    const UNINIT: ::std::mem::MaybeUninit<ip_frag_pkt__bindgen_ty_1> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<ip_frag_pkt__bindgen_ty_1>(),
-        16usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of ip_frag_pkt__bindgen_ty_1",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<ip_frag_pkt__bindgen_ty_1>(),
-        8usize,
+    ][::std::mem::size_of::<ip_frag_pkt__bindgen_ty_1>() - 16usize];
+    [
         "Alignment of ip_frag_pkt__bindgen_ty_1",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<ip_frag_pkt__bindgen_ty_1>() - 8usize];
+    [
         "Offset of field: ip_frag_pkt__bindgen_ty_1::tqe_next",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tqe_prev) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(ip_frag_pkt__bindgen_ty_1, tqe_next) - 0usize];
+    [
         "Offset of field: ip_frag_pkt__bindgen_ty_1::tqe_prev",
-    );
-}
+    ][::std::mem::offset_of!(ip_frag_pkt__bindgen_ty_1, tqe_prev) - 8usize];
+};
 impl Default for ip_frag_pkt__bindgen_ty_1 {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -186,52 +150,32 @@
         }
     }
 }
-#[test]
-fn bindgen_test_layout_ip_frag_pkt() {
-    const UNINIT: ::std::mem::MaybeUninit<ip_frag_pkt> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<ip_frag_pkt>(), 192usize, "Size of ip_frag_pkt");
-    assert_eq!(
-        ::std::mem::align_of::<ip_frag_pkt>(),
-        64usize,
-        "Alignment of ip_frag_pkt",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).lru) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of ip_frag_pkt"][::std::mem::size_of::<ip_frag_pkt>() - 192usize];
+    ["Alignment of ip_frag_pkt"][::std::mem::align_of::<ip_frag_pkt>() - 64usize];
+    [
         "Offset of field: ip_frag_pkt::lru",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, lru) - 0usize];
+    [
         "Offset of field: ip_frag_pkt::key",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize },
-        56usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, key) - 16usize];
+    [
         "Offset of field: ip_frag_pkt::start",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).total_size) as usize - ptr as usize },
-        64usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, start) - 56usize];
+    [
         "Offset of field: ip_frag_pkt::total_size",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).frag_size) as usize - ptr as usize },
-        68usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, total_size) - 64usize];
+    [
         "Offset of field: ip_frag_pkt::frag_size",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).last_idx) as usize - ptr as usize },
-        72usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, frag_size) - 68usize];
+    [
         "Offset of field: ip_frag_pkt::last_idx",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).frags) as usize - ptr as usize },
-        80usize,
+    ][::std::mem::offset_of!(ip_frag_pkt, last_idx) - 72usize];
+    [
         "Offset of field: ip_frag_pkt::frags",
-    );
-}
+    ][::std::mem::offset_of!(ip_frag_pkt, frags) - 80usize];
+};
 impl Default for ip_frag_pkt {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -247,27 +191,17 @@
     pub tqh_first: *mut ip_frag_pkt,
     pub tqh_last: *mut *mut ip_frag_pkt,
 }
-#[test]
-fn bindgen_test_layout_ip_pkt_list() {
-    const UNINIT: ::std::mem::MaybeUninit<ip_pkt_list> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<ip_pkt_list>(), 16usize, "Size of ip_pkt_list");
-    assert_eq!(
-        ::std::mem::align_of::<ip_pkt_list>(),
-        8usize,
-        "Alignment of ip_pkt_list",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of ip_pkt_list"][::std::mem::size_of::<ip_pkt_list>() - 16usize];
+    ["Alignment of ip_pkt_list"][::std::mem::align_of::<ip_pkt_list>() - 8usize];
+    [
         "Offset of field: ip_pkt_list::tqh_first",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).tqh_last) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(ip_pkt_list, tqh_first) - 0usize];
+    [
         "Offset of field: ip_pkt_list::tqh_last",
-    );
-}
+    ][::std::mem::offset_of!(ip_pkt_list, tqh_last) - 8usize];
+};
 impl Default for ip_pkt_list {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -280,7 +214,7 @@
 /// fragmentation table statistics
 #[repr(C)]
 #[repr(align(64))]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone)]
 pub struct ip_frag_tbl_stat {
     ///< total # of find/insert attempts.
     pub find_num: u64,
@@ -295,51 +229,31 @@
     ///< # of 'no space' add failures.
     pub fail_nospace: u64,
 }
-#[test]
-fn bindgen_test_layout_ip_frag_tbl_stat() {
-    const UNINIT: ::std::mem::MaybeUninit<ip_frag_tbl_stat> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<ip_frag_tbl_stat>(),
-        64usize,
-        "Size of ip_frag_tbl_stat",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<ip_frag_tbl_stat>(),
-        64usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of ip_frag_tbl_stat"][::std::mem::size_of::<ip_frag_tbl_stat>() - 64usize];
+    [
         "Alignment of ip_frag_tbl_stat",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).find_num) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<ip_frag_tbl_stat>() - 64usize];
+    [
         "Offset of field: ip_frag_tbl_stat::find_num",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).add_num) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(ip_frag_tbl_stat, find_num) - 0usize];
+    [
         "Offset of field: ip_frag_tbl_stat::add_num",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).del_num) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(ip_frag_tbl_stat, add_num) - 8usize];
+    [
         "Offset of field: ip_frag_tbl_stat::del_num",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).reuse_num) as usize - ptr as usize },
-        24usize,
+    ][::std::mem::offset_of!(ip_frag_tbl_stat, del_num) - 16usize];
+    [
         "Offset of field: ip_frag_tbl_stat::reuse_num",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).fail_total) as usize - ptr as usize },
-        32usize,
+    ][::std::mem::offset_of!(ip_frag_tbl_stat, reuse_num) - 24usize];
+    [
         "Offset of field: ip_frag_tbl_stat::fail_total",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).fail_nospace) as usize - ptr as usize },
-        40usize,
+    ][::std::mem::offset_of!(ip_frag_tbl_stat, fail_total) - 32usize];
+    [
         "Offset of field: ip_frag_tbl_stat::fail_nospace",
-    );
-}
+    ][::std::mem::offset_of!(ip_frag_tbl_stat, fail_nospace) - 40usize];
+};
 impl Default for ip_frag_tbl_stat {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -352,6 +266,7 @@
 /// fragmentation table
 #[repr(C)]
 #[repr(align(64))]
+#[derive(Debug)]
 pub struct rte_ip_frag_tbl {
     ///< ttl for table entries.
     pub max_cycles: u64,
@@ -377,76 +292,46 @@
     ///< hash table.
     pub pkt: __IncompleteArrayField<ip_frag_pkt>,
 }
-#[test]
-fn bindgen_test_layout_rte_ip_frag_tbl() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_ip_frag_tbl> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_ip_frag_tbl>(),
-        128usize,
-        "Size of rte_ip_frag_tbl",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_ip_frag_tbl>(),
-        64usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of rte_ip_frag_tbl"][::std::mem::size_of::<rte_ip_frag_tbl>() - 128usize];
+    [
         "Alignment of rte_ip_frag_tbl",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).max_cycles) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<rte_ip_frag_tbl>() - 64usize];
+    [
         "Offset of field: rte_ip_frag_tbl::max_cycles",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).entry_mask) as usize - ptr as usize },
-        8usize,
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, max_cycles) - 0usize];
+    [
         "Offset of field: rte_ip_frag_tbl::entry_mask",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).max_entries) as usize - ptr as usize },
-        12usize,
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, entry_mask) - 8usize];
+    [
         "Offset of field: rte_ip_frag_tbl::max_entries",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).use_entries) as usize - ptr as usize },
-        16usize,
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, max_entries) - 12usize];
+    [
         "Offset of field: rte_ip_frag_tbl::use_entries",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).bucket_entries) as usize - ptr as usize },
-        20usize,
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, use_entries) - 16usize];
+    [
         "Offset of field: rte_ip_frag_tbl::bucket_entries",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_entries) as usize - ptr as usize },
-        24usize,
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, bucket_entries) - 20usize];
+    [
         "Offset of field: rte_ip_frag_tbl::nb_entries",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).nb_buckets) as usize - ptr as usize },
-        28usize,
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, nb_entries) - 24usize];
+    [
         "Offset of field: rte_ip_frag_tbl::nb_buckets",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).last) as usize - ptr as usize },
-        32usize,
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, nb_buckets) - 28usize];
+    [
         "Offset of field: rte_ip_frag_tbl::last",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).lru) as usize - ptr as usize },
-        40usize,
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, last) - 32usize];
+    [
         "Offset of field: rte_ip_frag_tbl::lru",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize },
-        64usize,
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, lru) - 40usize];
+    [
         "Offset of field: rte_ip_frag_tbl::stat",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).pkt) as usize - ptr as usize },
-        128usize,
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, stat) - 64usize];
+    [
         "Offset of field: rte_ip_frag_tbl::pkt",
-    );
-}
+    ][::std::mem::offset_of!(rte_ip_frag_tbl, pkt) - 128usize];
+};
 impl Default for rte_ip_frag_tbl {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
diff --git a/bindgen-tests/tests/expectations/tests/long_double.rs b/bindgen-tests/tests/expectations/tests/long_double.rs
index aa3109c..4a8b13e 100644
--- a/bindgen-tests/tests/expectations/tests/long_double.rs
+++ b/bindgen-tests/tests/expectations/tests/long_double.rs
@@ -5,15 +5,9 @@
 pub struct foo {
     pub bar: u128,
 }
-#[test]
-fn bindgen_test_layout_foo() {
-    const UNINIT: ::std::mem::MaybeUninit<foo> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<foo>(), 16usize, "Size of foo");
-    assert_eq!(::std::mem::align_of::<foo>(), 16usize, "Alignment of foo");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).bar) as usize - ptr as usize },
-        0usize,
-        "Offset of field: foo::bar",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of foo"][::std::mem::size_of::<foo>() - 16usize];
+    ["Alignment of foo"][::std::mem::align_of::<foo>() - 16usize];
+    ["Offset of field: foo::bar"][::std::mem::offset_of!(foo, bar) - 0usize];
+};
diff --git a/bindgen-tests/tests/expectations/tests/no_debug_bypass_impl_debug.rs b/bindgen-tests/tests/expectations/tests/no_debug_bypass_impl_debug.rs
index d972c74..ceec382 100644
--- a/bindgen-tests/tests/expectations/tests/no_debug_bypass_impl_debug.rs
+++ b/bindgen-tests/tests/expectations/tests/no_debug_bypass_impl_debug.rs
@@ -1,5 +1,6 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 #[repr(C)]
+#[derive(Debug)]
 pub struct Generic<T> {
     pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
     pub t: [T; 40usize],
@@ -13,11 +14,6 @@
         }
     }
 }
-impl<T> ::std::fmt::Debug for Generic<T> {
-    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        write!(f, "Generic {{ t: Array with length 40 }}")
-    }
-}
 #[repr(C)]
 pub struct NoDebug<T> {
     pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
diff --git a/bindgen-tests/tests/expectations/tests/no_default_bypass_derive_default.rs b/bindgen-tests/tests/expectations/tests/no_default_bypass_derive_default.rs
index 58f3684..3dfd344 100644
--- a/bindgen-tests/tests/expectations/tests/no_default_bypass_derive_default.rs
+++ b/bindgen-tests/tests/expectations/tests/no_default_bypass_derive_default.rs
@@ -1,5 +1,6 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 #[repr(C)]
+#[derive(Debug)]
 pub struct Generic<T> {
     pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
     pub t: [T; 40usize],
@@ -14,6 +15,7 @@
     }
 }
 #[repr(C)]
+#[derive(Debug)]
 pub struct NoDefault<T> {
     pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
     pub t: [T; 40usize],
diff --git a/bindgen-tests/tests/expectations/tests/opaque-template-inst-member.rs b/bindgen-tests/tests/expectations/tests/opaque-template-inst-member.rs
index 4b070fa..cc02195 100644
--- a/bindgen-tests/tests/expectations/tests/opaque-template-inst-member.rs
+++ b/bindgen-tests/tests/expectations/tests/opaque-template-inst-member.rs
@@ -1,4 +1,14 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+/// If Bindgen could only determine the size and alignment of a
+/// type, it is represented like this.
+#[derive(PartialEq, Copy, Clone, Debug, Hash)]
+#[repr(C)]
+pub struct __BindgenOpaqueArray<T: Copy, const N: usize>(pub [T; N]);
+impl<T: Copy + Default, const N: usize> Default for __BindgenOpaqueArray<T, N> {
+    fn default() -> Self {
+        Self([<T as Default>::default(); N])
+    }
+}
 #[repr(C)]
 #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct OpaqueTemplate {
@@ -8,34 +18,24 @@
  Debug/Hash because the instantiation's definition cannot derive Debug/Hash.*/
 #[repr(C)]
 pub struct ContainsOpaqueTemplate {
-    pub mBlah: [u32; 101usize],
+    pub mBlah: __BindgenOpaqueArray<u32, 101usize>,
     pub mBaz: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_ContainsOpaqueTemplate() {
-    const UNINIT: ::std::mem::MaybeUninit<ContainsOpaqueTemplate> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<ContainsOpaqueTemplate>(),
-        408usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of ContainsOpaqueTemplate",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<ContainsOpaqueTemplate>(),
-        4usize,
+    ][::std::mem::size_of::<ContainsOpaqueTemplate>() - 408usize];
+    [
         "Alignment of ContainsOpaqueTemplate",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).mBlah) as usize - ptr as usize },
-        0usize,
+    ][::std::mem::align_of::<ContainsOpaqueTemplate>() - 4usize];
+    [
         "Offset of field: ContainsOpaqueTemplate::mBlah",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).mBaz) as usize - ptr as usize },
-        404usize,
+    ][::std::mem::offset_of!(ContainsOpaqueTemplate, mBlah) - 0usize];
+    [
         "Offset of field: ContainsOpaqueTemplate::mBaz",
-    );
-}
+    ][::std::mem::offset_of!(ContainsOpaqueTemplate, mBaz) - 404usize];
+};
 impl Default for ContainsOpaqueTemplate {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -47,36 +47,28 @@
 }
 impl ::std::cmp::PartialEq for ContainsOpaqueTemplate {
     fn eq(&self, other: &ContainsOpaqueTemplate) -> bool {
-        &self.mBlah[..] == &other.mBlah[..] && self.mBaz == other.mBaz
+        self.mBlah == other.mBlah && self.mBaz == other.mBaz
     }
 }
 /** This should not end up deriving Debug/Hash either, for similar reasons, although
  we're exercising base member edges now.*/
 #[repr(C)]
 pub struct InheritsOpaqueTemplate {
-    pub _base: [u8; 401usize],
+    pub _base: __BindgenOpaqueArray<u8, 401usize>,
     pub wow: *mut ::std::os::raw::c_char,
 }
-#[test]
-fn bindgen_test_layout_InheritsOpaqueTemplate() {
-    const UNINIT: ::std::mem::MaybeUninit<InheritsOpaqueTemplate> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<InheritsOpaqueTemplate>(),
-        416usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of InheritsOpaqueTemplate",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<InheritsOpaqueTemplate>(),
-        8usize,
+    ][::std::mem::size_of::<InheritsOpaqueTemplate>() - 416usize];
+    [
         "Alignment of InheritsOpaqueTemplate",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).wow) as usize - ptr as usize },
-        408usize,
+    ][::std::mem::align_of::<InheritsOpaqueTemplate>() - 8usize];
+    [
         "Offset of field: InheritsOpaqueTemplate::wow",
-    );
-}
+    ][::std::mem::offset_of!(InheritsOpaqueTemplate, wow) - 408usize];
+};
 impl Default for InheritsOpaqueTemplate {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -88,6 +80,6 @@
 }
 impl ::std::cmp::PartialEq for InheritsOpaqueTemplate {
     fn eq(&self, other: &InheritsOpaqueTemplate) -> bool {
-        &self._base[..] == &other._base[..] && self.wow == other.wow
+        self._base == other._base && self.wow == other.wow
     }
 }
diff --git a/bindgen-tests/tests/expectations/tests/packed-vtable.rs b/bindgen-tests/tests/expectations/tests/packed-vtable.rs
index 362017a..71e1956 100644
--- a/bindgen-tests/tests/expectations/tests/packed-vtable.rs
+++ b/bindgen-tests/tests/expectations/tests/packed-vtable.rs
@@ -6,25 +6,21 @@
 pub struct PackedVtable {
     pub vtable_: *const PackedVtable__bindgen_vtable,
 }
-#[test]
-fn bindgen_test_layout_PackedVtable() {
-    assert_eq!(::std::mem::size_of::<PackedVtable>(), 8usize, "Size of PackedVtable");
-    assert_eq!(
-        ::std::mem::align_of::<PackedVtable>(),
-        1usize,
-        "Alignment of PackedVtable",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of PackedVtable"][::std::mem::size_of::<PackedVtable>() - 8usize];
+    ["Alignment of PackedVtable"][::std::mem::align_of::<PackedVtable>() - 1usize];
+};
 impl Default for PackedVtable {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}_ZN12PackedVtableD1Ev"]
     pub fn PackedVtable_PackedVtable_destructor(this: *mut PackedVtable);
 }
diff --git a/bindgen-tests/tests/expectations/tests/repr-align.rs b/bindgen-tests/tests/expectations/tests/repr-align.rs
index 6afc0ba..867a28c 100644
--- a/bindgen-tests/tests/expectations/tests/repr-align.rs
+++ b/bindgen-tests/tests/expectations/tests/repr-align.rs
@@ -7,23 +7,13 @@
     pub b: ::std::os::raw::c_int,
     pub c: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_a() {
-    const UNINIT: ::std::mem::MaybeUninit<a> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<a>(), 8usize, "Size of a");
-    assert_eq!(::std::mem::align_of::<a>(), 8usize, "Alignment of a");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize },
-        0usize,
-        "Offset of field: a::b",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).c) as usize - ptr as usize },
-        4usize,
-        "Offset of field: a::c",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of a"][::std::mem::size_of::<a>() - 8usize];
+    ["Alignment of a"][::std::mem::align_of::<a>() - 8usize];
+    ["Offset of field: a::b"][::std::mem::offset_of!(a, b) - 0usize];
+    ["Offset of field: a::c"][::std::mem::offset_of!(a, c) - 4usize];
+};
 #[repr(C)]
 #[repr(align(8))]
 #[derive(Debug, Default, Copy, Clone)]
@@ -31,20 +21,10 @@
     pub b: ::std::os::raw::c_int,
     pub c: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_b() {
-    const UNINIT: ::std::mem::MaybeUninit<b> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<b>(), 8usize, "Size of b");
-    assert_eq!(::std::mem::align_of::<b>(), 8usize, "Alignment of b");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize },
-        0usize,
-        "Offset of field: b::b",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).c) as usize - ptr as usize },
-        4usize,
-        "Offset of field: b::c",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of b"][::std::mem::size_of::<b>() - 8usize];
+    ["Alignment of b"][::std::mem::align_of::<b>() - 8usize];
+    ["Offset of field: b::b"][::std::mem::offset_of!(b, b) - 0usize];
+    ["Offset of field: b::c"][::std::mem::offset_of!(b, c) - 4usize];
+};
diff --git a/bindgen-tests/tests/expectations/tests/struct_with_derive_debug.rs b/bindgen-tests/tests/expectations/tests/struct_with_derive_debug.rs
index b472666..f86fe6f 100644
--- a/bindgen-tests/tests/expectations/tests/struct_with_derive_debug.rs
+++ b/bindgen-tests/tests/expectations/tests/struct_with_derive_debug.rs
@@ -4,39 +4,23 @@
 pub struct LittleArray {
     pub a: [::std::os::raw::c_int; 32usize],
 }
-#[test]
-fn bindgen_test_layout_LittleArray() {
-    const UNINIT: ::std::mem::MaybeUninit<LittleArray> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<LittleArray>(), 128usize, "Size of LittleArray");
-    assert_eq!(
-        ::std::mem::align_of::<LittleArray>(),
-        4usize,
-        "Alignment of LittleArray",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        "Offset of field: LittleArray::a",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of LittleArray"][::std::mem::size_of::<LittleArray>() - 128usize];
+    ["Alignment of LittleArray"][::std::mem::align_of::<LittleArray>() - 4usize];
+    ["Offset of field: LittleArray::a"][::std::mem::offset_of!(LittleArray, a) - 0usize];
+};
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct BigArray {
     pub a: [::std::os::raw::c_int; 33usize],
 }
-#[test]
-fn bindgen_test_layout_BigArray() {
-    const UNINIT: ::std::mem::MaybeUninit<BigArray> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<BigArray>(), 132usize, "Size of BigArray");
-    assert_eq!(::std::mem::align_of::<BigArray>(), 4usize, "Alignment of BigArray");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        "Offset of field: BigArray::a",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of BigArray"][::std::mem::size_of::<BigArray>() - 132usize];
+    ["Alignment of BigArray"][::std::mem::align_of::<BigArray>() - 4usize];
+    ["Offset of field: BigArray::a"][::std::mem::offset_of!(BigArray, a) - 0usize];
+};
 impl Default for BigArray {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -51,47 +35,27 @@
 pub struct WithLittleArray {
     pub a: LittleArray,
 }
-#[test]
-fn bindgen_test_layout_WithLittleArray() {
-    const UNINIT: ::std::mem::MaybeUninit<WithLittleArray> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<WithLittleArray>(),
-        128usize,
-        "Size of WithLittleArray",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<WithLittleArray>(),
-        4usize,
-        "Alignment of WithLittleArray",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of WithLittleArray"][::std::mem::size_of::<WithLittleArray>() - 128usize];
+    ["Alignment of WithLittleArray"][::std::mem::align_of::<WithLittleArray>() - 4usize];
+    [
         "Offset of field: WithLittleArray::a",
-    );
-}
+    ][::std::mem::offset_of!(WithLittleArray, a) - 0usize];
+};
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct WithBigArray {
     pub a: BigArray,
 }
-#[test]
-fn bindgen_test_layout_WithBigArray() {
-    const UNINIT: ::std::mem::MaybeUninit<WithBigArray> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<WithBigArray>(), 132usize, "Size of WithBigArray");
-    assert_eq!(
-        ::std::mem::align_of::<WithBigArray>(),
-        4usize,
-        "Alignment of WithBigArray",
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of WithBigArray"][::std::mem::size_of::<WithBigArray>() - 132usize];
+    ["Alignment of WithBigArray"][::std::mem::align_of::<WithBigArray>() - 4usize];
+    [
         "Offset of field: WithBigArray::a",
-    );
-}
+    ][::std::mem::offset_of!(WithBigArray, a) - 0usize];
+};
 impl Default for WithBigArray {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
diff --git a/bindgen-tests/tests/expectations/tests/struct_with_large_array.rs b/bindgen-tests/tests/expectations/tests/struct_with_large_array.rs
index eda7cad..df7a219 100644
--- a/bindgen-tests/tests/expectations/tests/struct_with_large_array.rs
+++ b/bindgen-tests/tests/expectations/tests/struct_with_large_array.rs
@@ -1,21 +1,15 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 #[repr(C)]
-#[derive(Copy, Clone)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct S {
     pub large_array: [::std::os::raw::c_char; 33usize],
 }
-#[test]
-fn bindgen_test_layout_S() {
-    const UNINIT: ::std::mem::MaybeUninit<S> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<S>(), 33usize, "Size of S");
-    assert_eq!(::std::mem::align_of::<S>(), 1usize, "Alignment of S");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).large_array) as usize - ptr as usize },
-        0usize,
-        "Offset of field: S::large_array",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of S"][::std::mem::size_of::<S>() - 33usize];
+    ["Alignment of S"][::std::mem::align_of::<S>() - 1usize];
+    ["Offset of field: S::large_array"][::std::mem::offset_of!(S, large_array) - 0usize];
+};
 impl Default for S {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
@@ -26,6 +20,7 @@
     }
 }
 #[repr(C)]
+#[derive(Debug, Hash, PartialEq, Eq)]
 pub struct ST<T> {
     pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
     pub large_array: [T; 33usize],
diff --git a/bindgen-tests/tests/expectations/tests/transform-op.rs b/bindgen-tests/tests/expectations/tests/transform-op.rs
index c626049..7a12f2a 100644
--- a/bindgen-tests/tests/expectations/tests/transform-op.rs
+++ b/bindgen-tests/tests/expectations/tests/transform-op.rs
@@ -51,10 +51,10 @@
 }
 impl<T> Default for StylePoint<T> {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
@@ -84,10 +84,10 @@
 }
 impl<T> Default for StyleFoo_Foo_Body<T> {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
@@ -100,10 +100,10 @@
 }
 impl<T> Default for StyleFoo_Bar_Body<T> {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
@@ -116,10 +116,10 @@
 }
 impl<T> Default for StyleFoo_Baz_Body<T> {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
@@ -130,19 +130,19 @@
 }
 impl Default for StyleFoo__bindgen_ty_1 {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
 impl<T> Default for StyleFoo<T> {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
@@ -167,10 +167,10 @@
 }
 impl<T> Default for StyleBar_StyleBar1_Body<T> {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
@@ -182,10 +182,10 @@
 }
 impl<T> Default for StyleBar_StyleBar2_Body<T> {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
@@ -197,10 +197,10 @@
 }
 impl<T> Default for StyleBar_StyleBar3_Body<T> {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
@@ -215,45 +215,37 @@
 }
 impl<T> Default for StyleBar__bindgen_ty_1<T> {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
 impl<T> Default for StyleBar<T> {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
-#[test]
-fn __bindgen_test_layout_StylePoint_open0_float_close0_instantiation() {
-    assert_eq!(
-        ::std::mem::size_of::<StylePoint<f32>>(),
-        8usize,
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of template specialization: StylePoint_open0_float_close0",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<StylePoint<f32>>(),
-        4usize,
+    ][::std::mem::size_of::<StylePoint<f32>>() - 8usize];
+    [
         "Align of template specialization: StylePoint_open0_float_close0",
-    );
-}
-#[test]
-fn __bindgen_test_layout_StylePoint_open0_float_close0_instantiation_1() {
-    assert_eq!(
-        ::std::mem::size_of::<StylePoint<f32>>(),
-        8usize,
+    ][::std::mem::align_of::<StylePoint<f32>>() - 4usize];
+};
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    [
         "Size of template specialization: StylePoint_open0_float_close0",
-    );
-    assert_eq!(
-        ::std::mem::align_of::<StylePoint<f32>>(),
-        4usize,
+    ][::std::mem::size_of::<StylePoint<f32>>() - 8usize];
+    [
         "Align of template specialization: StylePoint_open0_float_close0",
-    );
-}
+    ][::std::mem::align_of::<StylePoint<f32>>() - 4usize];
+};
diff --git a/bindgen-tests/tests/expectations/tests/union-align.rs b/bindgen-tests/tests/expectations/tests/union-align.rs
index 2838ef3..bdb1bb3 100644
--- a/bindgen-tests/tests/expectations/tests/union-align.rs
+++ b/bindgen-tests/tests/expectations/tests/union-align.rs
@@ -5,24 +5,18 @@
 pub union Bar {
     pub foo: ::std::os::raw::c_uchar,
 }
-#[test]
-fn bindgen_test_layout_Bar() {
-    const UNINIT: ::std::mem::MaybeUninit<Bar> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<Bar>(), 16usize, "Size of Bar");
-    assert_eq!(::std::mem::align_of::<Bar>(), 16usize, "Alignment of Bar");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).foo) as usize - ptr as usize },
-        0usize,
-        "Offset of field: Bar::foo",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Bar"][::std::mem::size_of::<Bar>() - 16usize];
+    ["Alignment of Bar"][::std::mem::align_of::<Bar>() - 16usize];
+    ["Offset of field: Bar::foo"][::std::mem::offset_of!(Bar, foo) - 0usize];
+};
 impl Default for Bar {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
@@ -32,24 +26,18 @@
 pub union Baz {
     pub bar: Bar,
 }
-#[test]
-fn bindgen_test_layout_Baz() {
-    const UNINIT: ::std::mem::MaybeUninit<Baz> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<Baz>(), 16usize, "Size of Baz");
-    assert_eq!(::std::mem::align_of::<Baz>(), 16usize, "Alignment of Baz");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).bar) as usize - ptr as usize },
-        0usize,
-        "Offset of field: Baz::bar",
-    );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Baz"][::std::mem::size_of::<Baz>() - 16usize];
+    ["Alignment of Baz"][::std::mem::align_of::<Baz>() - 16usize];
+    ["Offset of field: Baz::bar"][::std::mem::offset_of!(Baz, bar) - 0usize];
+};
 impl Default for Baz {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
diff --git a/bindgen-tests/tests/expectations/tests/win32-dtors.rs b/bindgen-tests/tests/expectations/tests/win32-dtors.rs
index 042aa8c..d7ed129 100644
--- a/bindgen-tests/tests/expectations/tests/win32-dtors.rs
+++ b/bindgen-tests/tests/expectations/tests/win32-dtors.rs
@@ -4,32 +4,26 @@
 pub struct CppObj {
     pub x: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_CppObj() {
-    const UNINIT: ::std::mem::MaybeUninit<CppObj> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<CppObj>(), 4usize, "Size of CppObj");
-    assert_eq!(::std::mem::align_of::<CppObj>(), 4usize, "Alignment of CppObj");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
-        0usize,
-        "Offset of field: CppObj::x",
-    );
-}
-extern "C" {
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of CppObj"][::std::mem::size_of::<CppObj>() - 4usize];
+    ["Alignment of CppObj"][::std::mem::align_of::<CppObj>() - 4usize];
+    ["Offset of field: CppObj::x"][::std::mem::offset_of!(CppObj, x) - 0usize];
+};
+unsafe extern "C" {
     #[link_name = "\u{1}??0CppObj@@QEAA@H@Z"]
     pub fn CppObj_CppObj(this: *mut CppObj, x: ::std::os::raw::c_int);
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}??1CppObj@@QEAA@XZ"]
     pub fn CppObj_CppObj_destructor(this: *mut CppObj);
 }
 impl CppObj {
     #[inline]
     pub unsafe fn new(x: ::std::os::raw::c_int) -> Self {
-        let mut __bindgen_tmp = ::std::mem::uninitialized();
-        CppObj_CppObj(&mut __bindgen_tmp, x);
-        __bindgen_tmp
+        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
+        CppObj_CppObj(__bindgen_tmp.as_mut_ptr(), x);
+        __bindgen_tmp.assume_init()
     }
     #[inline]
     pub unsafe fn destruct(&mut self) {
@@ -44,40 +38,34 @@
     pub vtable_: *const CppObj2__bindgen_vtable,
     pub x: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_CppObj2() {
-    const UNINIT: ::std::mem::MaybeUninit<CppObj2> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<CppObj2>(), 16usize, "Size of CppObj2");
-    assert_eq!(::std::mem::align_of::<CppObj2>(), 8usize, "Alignment of CppObj2");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
-        8usize,
-        "Offset of field: CppObj2::x",
-    );
-}
-extern "C" {
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of CppObj2"][::std::mem::size_of::<CppObj2>() - 16usize];
+    ["Alignment of CppObj2"][::std::mem::align_of::<CppObj2>() - 8usize];
+    ["Offset of field: CppObj2::x"][::std::mem::offset_of!(CppObj2, x) - 8usize];
+};
+unsafe extern "C" {
     #[link_name = "\u{1}??0CppObj2@@QEAA@H@Z"]
     pub fn CppObj2_CppObj2(this: *mut CppObj2, x: ::std::os::raw::c_int);
 }
 impl Default for CppObj2 {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
 impl CppObj2 {
     #[inline]
     pub unsafe fn new(x: ::std::os::raw::c_int) -> Self {
-        let mut __bindgen_tmp = ::std::mem::uninitialized();
-        CppObj2_CppObj2(&mut __bindgen_tmp, x);
-        __bindgen_tmp
+        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
+        CppObj2_CppObj2(__bindgen_tmp.as_mut_ptr(), x);
+        __bindgen_tmp.assume_init()
     }
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}??1CppObj2@@UEAA@XZ"]
     pub fn CppObj2_CppObj2_destructor(this: *mut CppObj2);
 }
@@ -87,40 +75,34 @@
     pub _base: CppObj2,
     pub x: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_CppObj3() {
-    const UNINIT: ::std::mem::MaybeUninit<CppObj3> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<CppObj3>(), 24usize, "Size of CppObj3");
-    assert_eq!(::std::mem::align_of::<CppObj3>(), 8usize, "Alignment of CppObj3");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
-        16usize,
-        "Offset of field: CppObj3::x",
-    );
-}
-extern "C" {
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of CppObj3"][::std::mem::size_of::<CppObj3>() - 24usize];
+    ["Alignment of CppObj3"][::std::mem::align_of::<CppObj3>() - 8usize];
+    ["Offset of field: CppObj3::x"][::std::mem::offset_of!(CppObj3, x) - 16usize];
+};
+unsafe extern "C" {
     #[link_name = "\u{1}??0CppObj3@@QEAA@H@Z"]
     pub fn CppObj3_CppObj3(this: *mut CppObj3, x: ::std::os::raw::c_int);
 }
 impl Default for CppObj3 {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
 impl CppObj3 {
     #[inline]
     pub unsafe fn new(x: ::std::os::raw::c_int) -> Self {
-        let mut __bindgen_tmp = ::std::mem::uninitialized();
-        CppObj3_CppObj3(&mut __bindgen_tmp, x);
-        __bindgen_tmp
+        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
+        CppObj3_CppObj3(__bindgen_tmp.as_mut_ptr(), x);
+        __bindgen_tmp.assume_init()
     }
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}??1CppObj3@@UEAA@XZ"]
     pub fn CppObj3_CppObj3_destructor(this: *mut CppObj3);
 }
@@ -130,40 +112,34 @@
     pub _base: CppObj2,
     pub x: ::std::os::raw::c_int,
 }
-#[test]
-fn bindgen_test_layout_CppObj4() {
-    const UNINIT: ::std::mem::MaybeUninit<CppObj4> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<CppObj4>(), 24usize, "Size of CppObj4");
-    assert_eq!(::std::mem::align_of::<CppObj4>(), 8usize, "Alignment of CppObj4");
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
-        16usize,
-        "Offset of field: CppObj4::x",
-    );
-}
-extern "C" {
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of CppObj4"][::std::mem::size_of::<CppObj4>() - 24usize];
+    ["Alignment of CppObj4"][::std::mem::align_of::<CppObj4>() - 8usize];
+    ["Offset of field: CppObj4::x"][::std::mem::offset_of!(CppObj4, x) - 16usize];
+};
+unsafe extern "C" {
     #[link_name = "\u{1}??0CppObj4@@QEAA@H@Z"]
     pub fn CppObj4_CppObj4(this: *mut CppObj4, x: ::std::os::raw::c_int);
 }
 impl Default for CppObj4 {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
 impl CppObj4 {
     #[inline]
     pub unsafe fn new(x: ::std::os::raw::c_int) -> Self {
-        let mut __bindgen_tmp = ::std::mem::uninitialized();
-        CppObj4_CppObj4(&mut __bindgen_tmp, x);
-        __bindgen_tmp
+        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
+        CppObj4_CppObj4(__bindgen_tmp.as_mut_ptr(), x);
+        __bindgen_tmp.assume_init()
     }
 }
-extern "C" {
+unsafe extern "C" {
     #[link_name = "\u{1}??1CppObj4@@UEAA@XZ"]
     pub fn CppObj4_CppObj4_destructor(this: *mut CppObj4);
 }
diff --git a/bindgen-tests/tests/expectations/tests/win32-thiscall.rs b/bindgen-tests/tests/expectations/tests/win32-thiscall.rs
index d50348e..aecdfbb 100644
--- a/bindgen-tests/tests/expectations/tests/win32-thiscall.rs
+++ b/bindgen-tests/tests/expectations/tests/win32-thiscall.rs
@@ -1,11 +1,33 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+#![cfg(not(test))]
 #[repr(C)]
 #[derive(Debug, Default, Copy, Clone)]
 pub struct Foo {
     pub _address: u8,
 }
-#[test]
-fn bindgen_test_layout_Foo() {
-    assert_eq!(::std::mem::size_of::<Foo>(), 1usize, "Size of Foo");
-    assert_eq!(::std::mem::align_of::<Foo>(), 1usize, "Alignment of Foo");
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+    ["Size of Foo"][::std::mem::size_of::<Foo>() - 1usize];
+    ["Alignment of Foo"][::std::mem::align_of::<Foo>() - 1usize];
+};
+unsafe extern "thiscall" {
+    #[link_name = "\u{1}?test@Foo@@QAEXXZ"]
+    pub fn Foo_test(this: *mut Foo);
+}
+unsafe extern "thiscall" {
+    #[link_name = "\u{1}?test2@Foo@@QAEHH@Z"]
+    pub fn Foo_test2(
+        this: *mut Foo,
+        var: ::std::os::raw::c_int,
+    ) -> ::std::os::raw::c_int;
+}
+impl Foo {
+    #[inline]
+    pub unsafe fn test(&mut self) {
+        Foo_test(self)
+    }
+    #[inline]
+    pub unsafe fn test2(&mut self, var: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
+        Foo_test2(self, var)
+    }
 }
diff --git a/bindgen-tests/tests/expectations/tests/wrap_unsafe_ops_anon_union.rs b/bindgen-tests/tests/expectations/tests/wrap_unsafe_ops_anon_union.rs
index 50cefed..94bddf4 100644
--- a/bindgen-tests/tests/expectations/tests/wrap_unsafe_ops_anon_union.rs
+++ b/bindgen-tests/tests/expectations/tests/wrap_unsafe_ops_anon_union.rs
@@ -26,19 +26,19 @@
 }
 impl Default for TErrorResult__bindgen_ty_1 {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
 impl Default for TErrorResult {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
@@ -48,10 +48,10 @@
 }
 impl Default for ErrorResult {
     fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
         unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
         }
     }
 }
diff --git a/bindgen-tests/tests/headers/attribute_warn_unused_result.hpp b/bindgen-tests/tests/headers/attribute_warn_unused_result.hpp
index 258b639..bb9c368 100644
--- a/bindgen-tests/tests/headers/attribute_warn_unused_result.hpp
+++ b/bindgen-tests/tests/headers/attribute_warn_unused_result.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: \-\-rust-target=1.33 --enable-function-attribute-detection
+// bindgen-flags: --enable-function-attribute-detection
 
 class Foo {
 public:
diff --git a/bindgen-tests/tests/headers/attribute_warn_unused_result_no_attribute_detection.hpp b/bindgen-tests/tests/headers/attribute_warn_unused_result_no_attribute_detection.hpp
index a102cbf..25127d9 100644
--- a/bindgen-tests/tests/headers/attribute_warn_unused_result_no_attribute_detection.hpp
+++ b/bindgen-tests/tests/headers/attribute_warn_unused_result_no_attribute_detection.hpp
@@ -1,5 +1,3 @@
-// bindgen-flags: \-\-rust-target=1.33
-
 class Foo {
 public:
     __attribute__((warn_unused_result))
diff --git a/bindgen-tests/tests/headers/bindgen-union-inside-namespace.hpp b/bindgen-tests/tests/headers/bindgen-union-inside-namespace.hpp
index 78b05b4..4007e02 100644
--- a/bindgen-tests/tests/headers/bindgen-union-inside-namespace.hpp
+++ b/bindgen-tests/tests/headers/bindgen-union-inside-namespace.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: \-\-rust-target=1.33 --enable-cxx-namespaces
+// bindgen-flags: --enable-cxx-namespaces
 
 namespace foo {
   union Bar {
diff --git a/bindgen-tests/tests/headers/bitfield-enum-repr-c.hpp b/bindgen-tests/tests/headers/bitfield-enum-repr-c.hpp
index b80f5d9..da5fc96 100644
--- a/bindgen-tests/tests/headers/bitfield-enum-repr-c.hpp
+++ b/bindgen-tests/tests/headers/bitfield-enum-repr-c.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --bitfield-enum "Foo" \-\-rust-target=1.33  -- -std=c++11
+// bindgen-flags: --bitfield-enum "Foo" -- -std=c++11
 
 enum Foo {
   Bar = 1 << 1,
diff --git a/bindgen-tests/tests/headers/bitfield-enum-repr-transparent.hpp b/bindgen-tests/tests/headers/bitfield-enum-repr-transparent.hpp
index b80f5d9..1c58ff4 100644
--- a/bindgen-tests/tests/headers/bitfield-enum-repr-transparent.hpp
+++ b/bindgen-tests/tests/headers/bitfield-enum-repr-transparent.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --bitfield-enum "Foo" \-\-rust-target=1.33  -- -std=c++11
+// bindgen-flags: --bitfield-enum "Foo"
 
 enum Foo {
   Bar = 1 << 1,
diff --git a/bindgen-tests/tests/headers/class.hpp b/bindgen-tests/tests/headers/class.hpp
index a90e373..f77ac92 100644
--- a/bindgen-tests/tests/headers/class.hpp
+++ b/bindgen-tests/tests/headers/class.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --with-derive-partialord --with-derive-ord --rust-target 1.40
+// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --with-derive-partialord --with-derive-ord
 //
 class C {
     int a;
diff --git a/bindgen-tests/tests/headers/constructors_1_33.hpp b/bindgen-tests/tests/headers/constructors_1_33.hpp
index e275f89..b16c8c3 100644
--- a/bindgen-tests/tests/headers/constructors_1_33.hpp
+++ b/bindgen-tests/tests/headers/constructors_1_33.hpp
@@ -1,5 +1,3 @@
-// bindgen-flags: --rust-target 1.33
-
 class TestOverload {
   // This one shouldn't be generated.
   TestOverload();
diff --git a/bindgen-tests/tests/headers/derive-bitfield-method-same-name.hpp b/bindgen-tests/tests/headers/derive-bitfield-method-same-name.hpp
index ea9d801..4b7b21e 100644
--- a/bindgen-tests/tests/headers/derive-bitfield-method-same-name.hpp
+++ b/bindgen-tests/tests/headers/derive-bitfield-method-same-name.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-partialeq --impl-partialeq --impl-debug --rust-target 1.40
+// bindgen-flags: --with-derive-partialeq --impl-partialeq --impl-debug
 
 /// Because this struct have array larger than 32 items 
 /// and --with-derive-partialeq --impl-partialeq --impl-debug is provided, 
diff --git a/bindgen-tests/tests/headers/derive-clone.h b/bindgen-tests/tests/headers/derive-clone.h
index aacbcaf..8dc30ea 100644
--- a/bindgen-tests/tests/headers/derive-clone.h
+++ b/bindgen-tests/tests/headers/derive-clone.h
@@ -1,6 +1,3 @@
-// bindgen-flags: --rust-target 1.40
-//
-
 /// This struct should derive `Clone`.
 struct ShouldDeriveClone {
     int large[33];
diff --git a/bindgen-tests/tests/headers/derive-debug-bitfield-1-51.hpp b/bindgen-tests/tests/headers/derive-debug-bitfield-1-51.hpp
index a68611d..df43e6a 100644
--- a/bindgen-tests/tests/headers/derive-debug-bitfield-1-51.hpp
+++ b/bindgen-tests/tests/headers/derive-debug-bitfield-1-51.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --impl-debug --rust-target 1.51
+// bindgen-flags: --impl-debug
 
 class C {
   bool a: 1;
diff --git a/bindgen-tests/tests/headers/derive-debug-bitfield-core.hpp b/bindgen-tests/tests/headers/derive-debug-bitfield-core.hpp
index 2073cc2..5d78e74 100644
--- a/bindgen-tests/tests/headers/derive-debug-bitfield-core.hpp
+++ b/bindgen-tests/tests/headers/derive-debug-bitfield-core.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --impl-debug --use-core --raw-line "extern crate core;" --rust-target 1.40
+// bindgen-flags: --impl-debug --use-core --raw-line "extern crate core;"
 
 class C {
   bool a: 1;
diff --git a/bindgen-tests/tests/headers/derive-debug-bitfield.hpp b/bindgen-tests/tests/headers/derive-debug-bitfield.hpp
index b689190..df43e6a 100644
--- a/bindgen-tests/tests/headers/derive-debug-bitfield.hpp
+++ b/bindgen-tests/tests/headers/derive-debug-bitfield.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --impl-debug --rust-target 1.40
+// bindgen-flags: --impl-debug
 
 class C {
   bool a: 1;
diff --git a/bindgen-tests/tests/headers/derive-debug-function-pointer.hpp b/bindgen-tests/tests/headers/derive-debug-function-pointer.hpp
index 147097f..a370dee 100644
--- a/bindgen-tests/tests/headers/derive-debug-function-pointer.hpp
+++ b/bindgen-tests/tests/headers/derive-debug-function-pointer.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --impl-debug --rust-target 1.40
+// bindgen-flags: --impl-debug
 
 class Nice {
   typedef void (*Function) (int data);
diff --git a/bindgen-tests/tests/headers/derive-debug-generic.hpp b/bindgen-tests/tests/headers/derive-debug-generic.hpp
index 50122fa..d515851 100644
--- a/bindgen-tests/tests/headers/derive-debug-generic.hpp
+++ b/bindgen-tests/tests/headers/derive-debug-generic.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --impl-debug --rust-target 1.40
+// bindgen-flags: --impl-debug
 
 template<typename T>
 class Generic {
diff --git a/bindgen-tests/tests/headers/derive-debug-opaque-template-instantiation.hpp b/bindgen-tests/tests/headers/derive-debug-opaque-template-instantiation.hpp
index 0c70fcc..0dead78 100644
--- a/bindgen-tests/tests/headers/derive-debug-opaque-template-instantiation.hpp
+++ b/bindgen-tests/tests/headers/derive-debug-opaque-template-instantiation.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --impl-debug --rust-target 1.40
+// bindgen-flags: --impl-debug
 
 // This type is opaque because the second template parameter
 // is a non-type template parameter
diff --git a/bindgen-tests/tests/headers/derive-debug-opaque.hpp b/bindgen-tests/tests/headers/derive-debug-opaque.hpp
index 715d3c8..0ce1d63 100644
--- a/bindgen-tests/tests/headers/derive-debug-opaque.hpp
+++ b/bindgen-tests/tests/headers/derive-debug-opaque.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --opaque-type "Opaque" --impl-debug --rust-target 1.40
+// bindgen-flags: --opaque-type "Opaque" --impl-debug
 
 class Opaque {
   int i;
diff --git a/bindgen-tests/tests/headers/derive-partialeq-base.hpp b/bindgen-tests/tests/headers/derive-partialeq-base.hpp
index 2a57dca..989cbe6 100644
--- a/bindgen-tests/tests/headers/derive-partialeq-base.hpp
+++ b/bindgen-tests/tests/headers/derive-partialeq-base.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-partialeq --impl-partialeq --rust-target 1.40
+// bindgen-flags: --with-derive-partialeq --impl-partialeq
 
 class Base {
     int large[33];
diff --git a/bindgen-tests/tests/headers/derive-partialeq-bitfield.hpp b/bindgen-tests/tests/headers/derive-partialeq-bitfield.hpp
index f6dd82e..ac2cac6 100644
--- a/bindgen-tests/tests/headers/derive-partialeq-bitfield.hpp
+++ b/bindgen-tests/tests/headers/derive-partialeq-bitfield.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-partialeq --impl-partialeq --rust-target 1.40
+// bindgen-flags: --with-derive-partialeq --impl-partialeq
 
 class C {
     bool a: 1;
diff --git a/bindgen-tests/tests/headers/derive-partialeq-core.h b/bindgen-tests/tests/headers/derive-partialeq-core.h
index 18eed8b..6da5b78 100644
--- a/bindgen-tests/tests/headers/derive-partialeq-core.h
+++ b/bindgen-tests/tests/headers/derive-partialeq-core.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-partialeq --impl-partialeq --use-core --raw-line "extern crate core;" --rust-target 1.40
+// bindgen-flags: --with-derive-partialeq --impl-partialeq --use-core --raw-line "extern crate core;"
 
 struct C {
     int large_array[420];
diff --git a/bindgen-tests/tests/headers/extern-const-struct.h b/bindgen-tests/tests/headers/extern-const-struct.h
index 1027127..10006e8 100644
--- a/bindgen-tests/tests/headers/extern-const-struct.h
+++ b/bindgen-tests/tests/headers/extern-const-struct.h
@@ -1,5 +1,3 @@
-// bindgen-flags: --rust-target 1.40
-
 struct nsFoo {
   float details[400];
 };
diff --git a/bindgen-tests/tests/headers/extern_blocks_pre_1_82.h b/bindgen-tests/tests/headers/extern_blocks_pre_1_82.h
index abed05d..604625a 100644
--- a/bindgen-tests/tests/headers/extern_blocks_pre_1_82.h
+++ b/bindgen-tests/tests/headers/extern_blocks_pre_1_82.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --no-layout-tests --rust-target=1.81
+// bindgen-flags: --no-layout-tests
 
 void cool_function(int i, char c);
 
diff --git a/bindgen-tests/tests/headers/i128.h b/bindgen-tests/tests/headers/i128.h
index 609d546..1880f11 100644
--- a/bindgen-tests/tests/headers/i128.h
+++ b/bindgen-tests/tests/headers/i128.h
@@ -1,5 +1,3 @@
-// bindgen-flags: \-\-rust-target=1.33
-
 struct foo {
   __int128 my_signed;
   unsigned __int128 my_unsigned;
diff --git a/bindgen-tests/tests/headers/issue-1291.hpp b/bindgen-tests/tests/headers/issue-1291.hpp
index 313f7f7..cb4aeb9 100644
--- a/bindgen-tests/tests/headers/issue-1291.hpp
+++ b/bindgen-tests/tests/headers/issue-1291.hpp
@@ -1,4 +1,3 @@
-// bindgen-flags: \-\-rust-target=1.33
 // bindgen-unstable
 
 struct __attribute__((aligned(16))) RTCRay
diff --git a/bindgen-tests/tests/headers/issue-372.hpp b/bindgen-tests/tests/headers/issue-372.hpp
index a2a5d45..7127be2 100644
--- a/bindgen-tests/tests/headers/issue-372.hpp
+++ b/bindgen-tests/tests/headers/issue-372.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --enable-cxx-namespaces --rustified-enum ".*" --rust-target 1.40
+// bindgen-flags: --enable-cxx-namespaces --rustified-enum ".*"
 template <typename a, int b> class c { a e[b]; };
 class d;
 template <typename g, g f> class C { c<d, f> h; };
diff --git a/bindgen-tests/tests/headers/issue-537-repr-packed-n.h b/bindgen-tests/tests/headers/issue-537-repr-packed-n.h
index 7beaf88..40be004 100644
--- a/bindgen-tests/tests/headers/issue-537-repr-packed-n.h
+++ b/bindgen-tests/tests/headers/issue-537-repr-packed-n.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --raw-line '#![cfg(feature = "nightly")]' --rust-target 1.33
+// bindgen-flags: --raw-line '#![cfg(feature = "nightly")]'
 
 /// This should not be opaque; we can see the attributes and can pack the
 /// struct.
diff --git a/bindgen-tests/tests/headers/issue-648-derive-debug-with-padding.h b/bindgen-tests/tests/headers/issue-648-derive-debug-with-padding.h
index 0860ce9..d54fe37 100644
--- a/bindgen-tests/tests/headers/issue-648-derive-debug-with-padding.h
+++ b/bindgen-tests/tests/headers/issue-648-derive-debug-with-padding.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --impl-partialeq --rust-target 1.40
+// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --impl-partialeq
 /**
  * We emit a `[u8; 63usize]` padding field for this struct, which cannot derive
  * Debug/Hash because 63 is over the hard coded limit.
diff --git a/bindgen-tests/tests/headers/layout.h b/bindgen-tests/tests/headers/layout.h
index 0b3df26..06b7165 100644
--- a/bindgen-tests/tests/headers/layout.h
+++ b/bindgen-tests/tests/headers/layout.h
@@ -1,5 +1,3 @@
-// bindgen-flags: \-\-rust-target=1.33
-//
 // FIXME: https://github.com/rust-lang/rust-bindgen/issues/1498
 
 
diff --git a/bindgen-tests/tests/headers/layout_array.h b/bindgen-tests/tests/headers/layout_array.h
index e6a57f7..239e52b 100644
--- a/bindgen-tests/tests/headers/layout_array.h
+++ b/bindgen-tests/tests/headers/layout_array.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --impl-partialeq --rust-target 1.40
+// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --impl-partialeq
 typedef unsigned char uint8_t;
 typedef unsigned short uint16_t;
 typedef unsigned int uint32_t;
diff --git a/bindgen-tests/tests/headers/layout_array_too_long.h b/bindgen-tests/tests/headers/layout_array_too_long.h
index 53e4d8b..d0d34ba 100644
--- a/bindgen-tests/tests/headers/layout_array_too_long.h
+++ b/bindgen-tests/tests/headers/layout_array_too_long.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --impl-partialeq --rustified-enum ".*" --rust-target 1.40
+// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --impl-partialeq --rustified-enum ".*"
 typedef unsigned char uint8_t;
 typedef unsigned short uint16_t;
 typedef unsigned int uint32_t;
diff --git a/bindgen-tests/tests/headers/layout_eth_conf.h b/bindgen-tests/tests/headers/layout_eth_conf.h
index 1c821c9..ec1a691 100644
--- a/bindgen-tests/tests/headers/layout_eth_conf.h
+++ b/bindgen-tests/tests/headers/layout_eth_conf.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --rustified-enum ".*" --rust-target 1.40
+// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --rustified-enum ".*"
 typedef unsigned char uint8_t;
 typedef unsigned short uint16_t;
 typedef unsigned int uint32_t;
diff --git a/bindgen-tests/tests/headers/layout_kni_mbuf.h b/bindgen-tests/tests/headers/layout_kni_mbuf.h
index 4d604aa..148cb7d 100644
--- a/bindgen-tests/tests/headers/layout_kni_mbuf.h
+++ b/bindgen-tests/tests/headers/layout_kni_mbuf.h
@@ -1,5 +1,3 @@
-// bindgen-flags: --rust-target 1.40
-
 #define RTE_CACHE_LINE_MIN_SIZE 64	/**< Minimum Cache line size. */
 
 #define RTE_CACHE_LINE_SIZE 64
diff --git a/bindgen-tests/tests/headers/layout_large_align_field.h b/bindgen-tests/tests/headers/layout_large_align_field.h
index 63aea90..f292bb7 100644
--- a/bindgen-tests/tests/headers/layout_large_align_field.h
+++ b/bindgen-tests/tests/headers/layout_large_align_field.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --rustified-enum ".*" --rust-target 1.40
+// bindgen-flags: --rustified-enum ".*"
 
 typedef unsigned char uint8_t;
 typedef unsigned short uint16_t;
diff --git a/bindgen-tests/tests/headers/long_double.h b/bindgen-tests/tests/headers/long_double.h
index c8872d6..341be37 100644
--- a/bindgen-tests/tests/headers/long_double.h
+++ b/bindgen-tests/tests/headers/long_double.h
@@ -1,5 +1,3 @@
-// bindgen-flags: \-\-rust-target=1.33
-
 struct foo {
   long double bar;
 };
diff --git a/bindgen-tests/tests/headers/newtype-enum.hpp b/bindgen-tests/tests/headers/newtype-enum.hpp
index 45f3303..e711ed8 100644
--- a/bindgen-tests/tests/headers/newtype-enum.hpp
+++ b/bindgen-tests/tests/headers/newtype-enum.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --newtype-enum "Foo" \-\-rust-target=1.33  -- -std=c++11
+// bindgen-flags: --newtype-enum "Foo" -- -std=c++11
 
 enum Foo {
   Bar = 1 << 1,
diff --git a/bindgen-tests/tests/headers/newtype-global-enum.hpp b/bindgen-tests/tests/headers/newtype-global-enum.hpp
index e52b19b..c10825f 100644
--- a/bindgen-tests/tests/headers/newtype-global-enum.hpp
+++ b/bindgen-tests/tests/headers/newtype-global-enum.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --newtype-global-enum "Foo" \-\-rust-target=1.33  -- -std=c++11
+// bindgen-flags: --newtype-global-enum "Foo" -- -std=c++11
 
 enum Foo {
   Bar = 1 << 1,
diff --git a/bindgen-tests/tests/headers/no_debug_bypass_impl_debug.hpp b/bindgen-tests/tests/headers/no_debug_bypass_impl_debug.hpp
index d934d2c..a586441 100644
--- a/bindgen-tests/tests/headers/no_debug_bypass_impl_debug.hpp
+++ b/bindgen-tests/tests/headers/no_debug_bypass_impl_debug.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --no-debug "NoDebug" --impl-debug --rust-target 1.40
+// bindgen-flags: --no-debug "NoDebug" --impl-debug
 
 template<typename T>
 class Generic {
diff --git a/bindgen-tests/tests/headers/no_default_bypass_derive_default.hpp b/bindgen-tests/tests/headers/no_default_bypass_derive_default.hpp
index ab0fdfa..0f83390 100644
--- a/bindgen-tests/tests/headers/no_default_bypass_derive_default.hpp
+++ b/bindgen-tests/tests/headers/no_default_bypass_derive_default.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --no-default "NoDefault" --rust-target 1.40
+// bindgen-flags: --no-default "NoDefault"
 
 template<typename T>
 class Generic {
diff --git a/bindgen-tests/tests/headers/opaque-template-inst-member.hpp b/bindgen-tests/tests/headers/opaque-template-inst-member.hpp
index 9b32791..6516aa5 100644
--- a/bindgen-tests/tests/headers/opaque-template-inst-member.hpp
+++ b/bindgen-tests/tests/headers/opaque-template-inst-member.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --opaque-type 'OpaqueTemplate' --with-derive-hash --with-derive-partialeq --impl-partialeq --with-derive-eq --rust-target 1.40
+// bindgen-flags: --opaque-type 'OpaqueTemplate' --with-derive-hash --with-derive-partialeq --impl-partialeq --with-derive-eq
 
 template<typename T>
 class OpaqueTemplate {
diff --git a/bindgen-tests/tests/headers/packed-vtable.h b/bindgen-tests/tests/headers/packed-vtable.h
index d2413d4..b340597 100644
--- a/bindgen-tests/tests/headers/packed-vtable.h
+++ b/bindgen-tests/tests/headers/packed-vtable.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --raw-line '#![cfg(feature = "nightly")]' --rust-target 1.33 -- -x c++ -std=c++11
+// bindgen-flags: --raw-line '#![cfg(feature = "nightly")]' -- -x c++ -std=c++11
 
 #pragma pack(1)
 
diff --git a/bindgen-tests/tests/headers/repr-align.hpp b/bindgen-tests/tests/headers/repr-align.hpp
index b3231d3..a7719e1 100644
--- a/bindgen-tests/tests/headers/repr-align.hpp
+++ b/bindgen-tests/tests/headers/repr-align.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --raw-line '#![cfg(feature = "nightly")]' \-\-rust-target=1.33 -- -std=c++11
+// bindgen-flags: --raw-line '#![cfg(feature = "nightly")]' -- -std=c++11
 
 struct alignas(8) a {
   int b;
diff --git a/bindgen-tests/tests/headers/strings_array.h b/bindgen-tests/tests/headers/strings_array.h
index 212b090..fa7bf56 100644
--- a/bindgen-tests/tests/headers/strings_array.h
+++ b/bindgen-tests/tests/headers/strings_array.h
@@ -1,5 +1,3 @@
-// bindgen-flags: \-\-rust-target=1.33
-
 const char* MY_STRING_UTF8 = "Hello, world!";
 const char* MY_STRING_INTERIOR_NULL = "Hello,\0World!";
 const char* MY_STRING_NON_UTF8 = "ABCDE\xFF";
diff --git a/bindgen-tests/tests/headers/struct_with_derive_debug.h b/bindgen-tests/tests/headers/struct_with_derive_debug.h
index 4dc816b..201748d 100644
--- a/bindgen-tests/tests/headers/struct_with_derive_debug.h
+++ b/bindgen-tests/tests/headers/struct_with_derive_debug.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --rust-target 1.40
+// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq
 //
 struct LittleArray {
     int a[32];
diff --git a/bindgen-tests/tests/headers/struct_with_large_array.hpp b/bindgen-tests/tests/headers/struct_with_large_array.hpp
index 974ca52..58e8e4d 100644
--- a/bindgen-tests/tests/headers/struct_with_large_array.hpp
+++ b/bindgen-tests/tests/headers/struct_with_large_array.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --rust-target 1.40
+// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq
 //
 struct S {
     char large_array[33];
diff --git a/bindgen-tests/tests/headers/transform-op.hpp b/bindgen-tests/tests/headers/transform-op.hpp
index 907a5a4..090e88b 100644
--- a/bindgen-tests/tests/headers/transform-op.hpp
+++ b/bindgen-tests/tests/headers/transform-op.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: \-\-rust-target=1.33 -- -std=c++11
+// bindgen-flags: -- -std=c++11
 
 typedef unsigned char uint8_t;
 typedef int int32_t;
diff --git a/bindgen-tests/tests/headers/union-align.h b/bindgen-tests/tests/headers/union-align.h
index bfb5b5a..5ed955f 100644
--- a/bindgen-tests/tests/headers/union-align.h
+++ b/bindgen-tests/tests/headers/union-align.h
@@ -1,5 +1,3 @@
-// bindgen-flags: \-\-rust-target=1.33
-
 union Bar {
   unsigned char foo;
 } __attribute__ ((__aligned__ (16)));
diff --git a/bindgen-tests/tests/headers/win32-dtors.hpp b/bindgen-tests/tests/headers/win32-dtors.hpp
index 7faa5e9..0f0f0e1 100644
--- a/bindgen-tests/tests/headers/win32-dtors.hpp
+++ b/bindgen-tests/tests/headers/win32-dtors.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: \-\-rust-target=1.33 -- --target=x86_64-pc-windows-msvc
+// bindgen-flags: -- --target=x86_64-pc-windows-msvc
 
 struct CppObj {
     int x;
@@ -26,4 +26,4 @@
 
     CppObj4(int x);
     ~CppObj4();
-};
\ No newline at end of file
+};
diff --git a/bindgen-tests/tests/headers/win32-thiscall.hpp b/bindgen-tests/tests/headers/win32-thiscall.hpp
index d4e3976..4651f80 100644
--- a/bindgen-tests/tests/headers/win32-thiscall.hpp
+++ b/bindgen-tests/tests/headers/win32-thiscall.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: \-\-rust-target=1.33 -- --target=i686-pc-windows-msvc
+// bindgen-flags: --raw-line "#![cfg(not(test))]" -- --target=i686-pc-windows-msvc
 
 class Foo {
   public:
diff --git a/bindgen-tests/tests/headers/win32-vectorcall.h b/bindgen-tests/tests/headers/win32-vectorcall.h
index 245d97b..3fe36f1 100644
--- a/bindgen-tests/tests/headers/win32-vectorcall.h
+++ b/bindgen-tests/tests/headers/win32-vectorcall.h
@@ -1,3 +1,3 @@
-// bindgen-flags: \-\-rust-target=1.33 -- --target=x86_64-pc-windows-msvc
+// bindgen-flags: -- --target=x86_64-pc-windows-msvc
 
 int __vectorcall test_vectorcall(int a, int b);
diff --git a/bindgen-tests/tests/headers/wrap_unsafe_ops_anon_union.hpp b/bindgen-tests/tests/headers/wrap_unsafe_ops_anon_union.hpp
index e44b432..34faea5 100644
--- a/bindgen-tests/tests/headers/wrap_unsafe_ops_anon_union.hpp
+++ b/bindgen-tests/tests/headers/wrap_unsafe_ops_anon_union.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: \-\-rust-target=1.33 --wrap-unsafe-ops --no-layout-tests
+// bindgen-flags: --wrap-unsafe-ops --no-layout-tests
 
 template<typename T>
 struct TErrorResult {
diff --git a/bindgen/codegen/bitfield_unit.rs b/bindgen/codegen/bitfield_unit.rs
index 59c66f8..8be311e 100644
--- a/bindgen/codegen/bitfield_unit.rs
+++ b/bindgen/codegen/bitfield_unit.rs
@@ -39,6 +39,19 @@
     }
 
     #[inline]
+    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+
+        let byte_index = index / 8;
+        let byte = unsafe {
+            *(core::ptr::addr_of!((*this).storage) as *const u8)
+                .offset(byte_index as isize)
+        };
+
+        Self::extract_bit(byte, index)
+    }
+
+    #[inline]
     fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
         let bit_index = if cfg!(target_endian = "big") {
             7 - (index % 8)
@@ -65,6 +78,19 @@
     }
 
     #[inline]
+    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
+        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
+
+        let byte_index = index / 8;
+        let byte = unsafe {
+            (core::ptr::addr_of_mut!((*this).storage) as *mut u8)
+                .offset(byte_index as isize)
+        };
+
+        unsafe { *byte = Self::change_bit(*byte, index, val) };
+    }
+
+    #[inline]
     pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -90,6 +116,35 @@
     }
 
     #[inline]
+    pub unsafe fn raw_get(
+        this: *const Self,
+        bit_offset: usize,
+        bit_width: u8,
+    ) -> u64 {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <=
+                core::mem::size_of::<Storage>()
+        );
+
+        let mut val = 0;
+
+        for i in 0..(bit_width as usize) {
+            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
+                let index = if cfg!(target_endian = "big") {
+                    bit_width as usize - 1 - i
+                } else {
+                    i
+                };
+                val |= 1 << index;
+            }
+        }
+
+        val
+    }
+
+    #[inline]
     pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
         debug_assert!(bit_width <= 64);
         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -109,4 +164,32 @@
             self.set_bit(index + bit_offset, val_bit_is_set);
         }
     }
+
+    #[inline]
+    pub unsafe fn raw_set(
+        this: *mut Self,
+        bit_offset: usize,
+        bit_width: u8,
+        val: u64,
+    ) {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
+        debug_assert!(
+            (bit_offset + (bit_width as usize)) / 8 <=
+                core::mem::size_of::<Storage>()
+        );
+
+        for i in 0..(bit_width as usize) {
+            let mask = 1 << i;
+            let val_bit_is_set = val & mask == mask;
+            let index = if cfg!(target_endian = "big") {
+                bit_width as usize - 1 - i
+            } else {
+                i
+            };
+            unsafe {
+                Self::raw_set_bit(this, index + bit_offset, val_bit_is_set)
+            };
+        }
+    }
 }
diff --git a/bindgen/codegen/bitfield_unit_raw_ref_macros.rs b/bindgen/codegen/bitfield_unit_raw_ref_macros.rs
deleted file mode 100644
index 0c864c7..0000000
--- a/bindgen/codegen/bitfield_unit_raw_ref_macros.rs
+++ /dev/null
@@ -1,191 +0,0 @@
-#[repr(C)]
-#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub struct __BindgenBitfieldUnit<Storage> {
-    storage: Storage,
-}
-
-impl<Storage> __BindgenBitfieldUnit<Storage> {
-    #[inline]
-    pub const fn new(storage: Storage) -> Self {
-        Self { storage }
-    }
-}
-
-impl<Storage> __BindgenBitfieldUnit<Storage>
-where
-    Storage: AsRef<[u8]> + AsMut<[u8]>,
-{
-    #[inline]
-    fn extract_bit(byte: u8, index: usize) -> bool {
-        let bit_index = if cfg!(target_endian = "big") {
-            7 - (index % 8)
-        } else {
-            index % 8
-        };
-
-        let mask = 1 << bit_index;
-
-        byte & mask == mask
-    }
-
-    #[inline]
-    pub fn get_bit(&self, index: usize) -> bool {
-        debug_assert!(index / 8 < self.storage.as_ref().len());
-
-        let byte_index = index / 8;
-        let byte = self.storage.as_ref()[byte_index];
-
-        Self::extract_bit(byte, index)
-    }
-
-    #[inline]
-    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
-        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
-
-        let byte_index = index / 8;
-        let byte = unsafe { *(core::ptr::addr_of!((*this).storage) as *const u8)
-            .offset(byte_index as isize) };
-
-        Self::extract_bit(byte, index)
-    }
-
-    #[inline]
-    fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
-        let bit_index = if cfg!(target_endian = "big") {
-            7 - (index % 8)
-        } else {
-            index % 8
-        };
-
-        let mask = 1 << bit_index;
-        if val {
-            byte | mask
-        } else {
-            byte & !mask
-        }
-    }
-
-    #[inline]
-    pub fn set_bit(&mut self, index: usize, val: bool) {
-        debug_assert!(index / 8 < self.storage.as_ref().len());
-
-        let byte_index = index / 8;
-        let byte = &mut self.storage.as_mut()[byte_index];
-
-        *byte = Self::change_bit(*byte, index, val);
-    }
-
-    #[inline]
-    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
-        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
-
-        let byte_index = index / 8;
-        let byte = unsafe {
-            (core::ptr::addr_of_mut!((*this).storage) as *mut u8)
-                .offset(byte_index as isize)
-        };
-
-        unsafe { *byte = Self::change_bit(*byte, index, val) };
-    }
-
-    #[inline]
-    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
-        debug_assert!(bit_width <= 64);
-        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
-        debug_assert!(
-            (bit_offset + (bit_width as usize)) / 8 <=
-                self.storage.as_ref().len()
-        );
-
-        let mut val = 0;
-
-        for i in 0..(bit_width as usize) {
-            if self.get_bit(i + bit_offset) {
-                let index = if cfg!(target_endian = "big") {
-                    bit_width as usize - 1 - i
-                } else {
-                    i
-                };
-                val |= 1 << index;
-            }
-        }
-
-        val
-    }
-
-    #[inline]
-    pub unsafe fn raw_get(
-        this: *const Self,
-        bit_offset: usize,
-        bit_width: u8,
-    ) -> u64 {
-        debug_assert!(bit_width <= 64);
-        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
-        debug_assert!(
-            (bit_offset + (bit_width as usize)) / 8 <=
-                core::mem::size_of::<Storage>()
-        );
-
-        let mut val = 0;
-
-        for i in 0..(bit_width as usize) {
-            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
-                let index = if cfg!(target_endian = "big") {
-                    bit_width as usize - 1 - i
-                } else {
-                    i
-                };
-                val |= 1 << index;
-            }
-        }
-
-        val
-    }
-
-    #[inline]
-    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
-        debug_assert!(bit_width <= 64);
-        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
-        debug_assert!(
-            (bit_offset + (bit_width as usize)) / 8 <=
-                self.storage.as_ref().len()
-        );
-
-        for i in 0..(bit_width as usize) {
-            let mask = 1 << i;
-            let val_bit_is_set = val & mask == mask;
-            let index = if cfg!(target_endian = "big") {
-                bit_width as usize - 1 - i
-            } else {
-                i
-            };
-            self.set_bit(index + bit_offset, val_bit_is_set);
-        }
-    }
-
-    #[inline]
-    pub unsafe fn raw_set(
-        this: *mut Self,
-        bit_offset: usize,
-        bit_width: u8,
-        val: u64,
-    ) {
-        debug_assert!(bit_width <= 64);
-        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
-        debug_assert!(
-            (bit_offset + (bit_width as usize)) / 8 <=
-                core::mem::size_of::<Storage>()
-        );
-
-        for i in 0..(bit_width as usize) {
-            let mask = 1 << i;
-            let val_bit_is_set = val & mask == mask;
-            let index = if cfg!(target_endian = "big") {
-                bit_width as usize - 1 - i
-            } else {
-                i
-            };
-            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
-        }
-    }
-}
diff --git a/bindgen/codegen/helpers.rs b/bindgen/codegen/helpers.rs
index 82172f3..9b2e525 100644
--- a/bindgen/codegen/helpers.rs
+++ b/bindgen/codegen/helpers.rs
@@ -100,7 +100,7 @@
 
     if data_len == 1 {
         ty
-    } else if ffi_safe && ctx.options().rust_features().min_const_generics {
+    } else if ffi_safe {
         ctx.generated_opaque_array();
         if ctx.options().enable_cxx_namespaces {
             syn::parse_quote! { root::__BindgenOpaqueArray<#ty, #data_len> }
@@ -139,7 +139,6 @@
     use crate::ir::function::FunctionSig;
     use crate::ir::layout::Layout;
     use crate::ir::ty::{FloatKind, IntKind};
-    use crate::RustTarget;
     use proc_macro2::TokenStream;
     use std::str::FromStr;
 
@@ -311,60 +310,22 @@
         }
     }
 
-    pub(crate) fn float_expr(
-        ctx: &BindgenContext,
-        f: f64,
-    ) -> Result<TokenStream, ()> {
+    pub(crate) fn float_expr(f: f64) -> Result<TokenStream, ()> {
         if f.is_finite() {
             let val = proc_macro2::Literal::f64_unsuffixed(f);
 
             return Ok(quote!(#val));
         }
 
-        let prefix = ctx.trait_prefix();
-        let rust_target = ctx.options().rust_target;
-
         if f.is_nan() {
-            // FIXME: This should be done behind a `RustFeature` instead
-            #[allow(deprecated)]
-            let tokens = if rust_target >= RustTarget::Stable_1_43 {
-                quote! {
-                    f64::NAN
-                }
-            } else {
-                quote! {
-                    ::#prefix::f64::NAN
-                }
-            };
-            return Ok(tokens);
+            return Ok(quote! { f64::NAN });
         }
 
         if f.is_infinite() {
             let tokens = if f.is_sign_positive() {
-                // FIXME: This should be done behind a `RustFeature` instead
-                #[allow(deprecated)]
-                if rust_target >= RustTarget::Stable_1_43 {
-                    quote! {
-                        f64::INFINITY
-                    }
-                } else {
-                    quote! {
-                        ::#prefix::f64::INFINITY
-                    }
-                }
+                quote! { f64::INFINITY }
             } else {
-                // FIXME: This should be done behind a `RustFeature` instead
-                #[allow(deprecated)]
-                // Negative infinity
-                if rust_target >= RustTarget::Stable_1_43 {
-                    quote! {
-                        f64::NEG_INFINITY
-                    }
-                } else {
-                    quote! {
-                        ::#prefix::f64::NEG_INFINITY
-                    }
-                }
+                quote! { f64::NEG_INFINITY }
             };
             return Ok(tokens);
         }
diff --git a/bindgen/codegen/impl_debug.rs b/bindgen/codegen/impl_debug.rs
index 058a73b..4539472 100644
--- a/bindgen/codegen/impl_debug.rs
+++ b/bindgen/codegen/impl_debug.rs
@@ -1,7 +1,7 @@
 use crate::ir::comp::{BitfieldUnit, CompKind, Field, FieldData, FieldMethods};
 use crate::ir::context::BindgenContext;
 use crate::ir::item::{HasTypeParamInArray, IsOpaque, Item, ItemCanonicalName};
-use crate::ir::ty::{TypeKind, RUST_DERIVE_IN_ARRAY_LIMIT};
+use crate::ir::ty::TypeKind;
 use std::fmt::Write as _;
 
 pub(crate) fn gen_debug_impl(
@@ -173,32 +173,9 @@
                 // Generics are not required to implement Debug
                 if self.has_type_param_in_array(ctx) {
                     Some((format!("{name}: Array with length {len}"), vec![]))
-                } else if len < RUST_DERIVE_IN_ARRAY_LIMIT ||
-                    ctx.options().rust_features().larger_arrays
-                {
+                } else {
                     // The simple case
                     debug_print(name, &quote! { #name_ident })
-                } else if ctx.options().use_core {
-                    // There is no String in core; reducing field visibility to avoid breaking
-                    // no_std setups.
-                    Some((format!("{name}: [...]"), vec![]))
-                } else {
-                    // Let's implement our own print function
-                    Some((
-                        format!("{name}: [{{}}]"),
-                        vec![quote! {{
-                            use std::fmt::Write as _;
-                            let mut output = String::new();
-                            let mut iter = self.#name_ident.iter();
-                            if let Some(value) = iter.next() {
-                                let _ = write!(output, "{value:?}");
-                                for value in iter {
-                                    let _ = write!(output, ", {value:?}");
-                                }
-                            }
-                            output
-                        }}],
-                    ))
                 }
             }
             TypeKind::Vector(_, len) => {
diff --git a/bindgen/codegen/impl_partialeq.rs b/bindgen/codegen/impl_partialeq.rs
index c278796..a8edb47 100644
--- a/bindgen/codegen/impl_partialeq.rs
+++ b/bindgen/codegen/impl_partialeq.rs
@@ -1,7 +1,7 @@
 use crate::ir::comp::{CompInfo, CompKind, Field, FieldMethods};
 use crate::ir::context::BindgenContext;
 use crate::ir::item::{IsOpaque, Item};
-use crate::ir::ty::{TypeKind, RUST_DERIVE_IN_ARRAY_LIMIT};
+use crate::ir::ty::TypeKind;
 
 /// Generate a manual implementation of `PartialEq` trait for the
 /// specified compound type.
@@ -30,15 +30,7 @@
 
             let ty_item = ctx.resolve_item(base.ty);
             let field_name = &base.field_name;
-
-            if ty_item.is_opaque(ctx, &()) {
-                let field_name = ctx.rust_ident(field_name);
-                tokens.push(quote! {
-                    &self. #field_name [..] == &other. #field_name [..]
-                });
-            } else {
-                tokens.push(gen_field(ctx, ty_item, field_name));
-            }
+            tokens.push(gen_field(ctx, ty_item, field_name));
         }
 
         for field in comp_info.fields() {
@@ -100,29 +92,9 @@
         TypeKind::Comp(..) |
         TypeKind::Pointer(_) |
         TypeKind::Function(..) |
+        TypeKind::Array(..) |
+        TypeKind::TemplateInstantiation(..) |
         TypeKind::Opaque => quote_equals(&name_ident),
-
-        TypeKind::TemplateInstantiation(ref inst) => {
-            if inst.is_opaque(ctx, ty_item) {
-                quote! {
-                    &self. #name_ident [..] == &other. #name_ident [..]
-                }
-            } else {
-                quote_equals(&name_ident)
-            }
-        }
-
-        TypeKind::Array(_, len) => {
-            if len <= RUST_DERIVE_IN_ARRAY_LIMIT ||
-                ctx.options().rust_features().larger_arrays
-            {
-                quote_equals(&name_ident)
-            } else {
-                quote! {
-                    &self. #name_ident [..] == &other. #name_ident [..]
-                }
-            }
-        }
         TypeKind::Vector(_, len) => {
             let self_ids = 0..len;
             let other_ids = 0..len;
diff --git a/bindgen/codegen/mod.rs b/bindgen/codegen/mod.rs
index 5425962..25118f2 100644
--- a/bindgen/codegen/mod.rs
+++ b/bindgen/codegen/mod.rs
@@ -726,7 +726,6 @@
                         } else {
                             None
                         };
-
                     if let Some(cstr) = cstr {
                         let cstr_ty = quote! { ::#prefix::ffi::CStr };
                         if rust_features.literal_cstr {
@@ -763,7 +762,7 @@
                     }
                 }
                 VarType::Float(f) => {
-                    if let Ok(expr) = helpers::ast_ty::float_expr(ctx, f) {
+                    if let Ok(expr) = helpers::ast_ty::float_expr(f) {
                         result.push(quote! {
                             #(#attrs)*
                             pub const #canonical_ident : #ty = #expr ;
@@ -1792,12 +1791,6 @@
                 continue;
             }
 
-            if layout.size > RUST_DERIVE_IN_ARRAY_LIMIT &&
-                !ctx.options().rust_features().larger_arrays
-            {
-                continue;
-            }
-
             let mut bitfield_representable_as_int = true;
             let mut bitfield_visibility = visibility_kind;
             bf.codegen(
@@ -2005,33 +1998,31 @@
                 }
             }));
 
-            if ctx.options().rust_features.raw_ref_macros {
-                methods.extend(Some(quote! {
-                    #[inline]
-                    #access_spec unsafe fn #raw_getter_name(this: *const Self) -> #bitfield_ty {
-                        unsafe {
-                            ::#prefix::mem::transmute(<#unit_field_ty>::raw_get(
-                                (*::#prefix::ptr::addr_of!((*this).#unit_field_ident)).as_ref() as *const _,
-                                #offset,
-                                #width,
-                            ) as #bitfield_int_ty)
-                        }
+            methods.extend(Some(quote! {
+                #[inline]
+                #access_spec unsafe fn #raw_getter_name(this: *const Self) -> #bitfield_ty {
+                    unsafe {
+                        ::#prefix::mem::transmute(<#unit_field_ty>::raw_get(
+                            (*::#prefix::ptr::addr_of!((*this).#unit_field_ident)).as_ref() as *const _,
+                            #offset,
+                            #width,
+                        ) as #bitfield_int_ty)
                     }
+                }
 
-                    #[inline]
-                    #access_spec unsafe fn #raw_setter_name(this: *mut Self, val: #bitfield_ty) {
-                        unsafe {
-                            let val: #bitfield_int_ty = ::#prefix::mem::transmute(val);
-                            <#unit_field_ty>::raw_set(
-                                (*::#prefix::ptr::addr_of_mut!((*this).#unit_field_ident)).as_mut() as *mut _,
-                                #offset,
-                                #width,
-                                val as u64,
-                            )
-                        }
+                #[inline]
+                #access_spec unsafe fn #raw_setter_name(this: *mut Self, val: #bitfield_ty) {
+                    unsafe {
+                        let val: #bitfield_int_ty = ::#prefix::mem::transmute(val);
+                        <#unit_field_ty>::raw_set(
+                            (*::#prefix::ptr::addr_of_mut!((*this).#unit_field_ident)).as_mut() as *mut _,
+                            #offset,
+                            #width,
+                            val as u64,
+                        )
                     }
-                }));
-            }
+                }
+            }));
         } else {
             methods.extend(Some(quote! {
                 #[inline]
@@ -2057,8 +2048,7 @@
                 }
             }));
 
-            if ctx.options().rust_features.raw_ref_macros {
-                methods.extend(Some(quote! {
+            methods.extend(Some(quote! {
                 #[inline]
                 #access_spec unsafe fn #raw_getter_name(this: *const Self) -> #bitfield_ty {
                     unsafe {
@@ -2083,7 +2073,6 @@
                     }
                 }
             }));
-            }
         }
     }
 }
@@ -2401,7 +2390,6 @@
                 self.already_packed(ctx).unwrap_or(false))
         {
             let n = layout.map_or(1, |l| l.align);
-            assert!(ctx.options().rust_features().repr_packed_n || n == 1);
             let packed_repr = if n == 1 {
                 "packed".to_string()
             } else {
@@ -2761,21 +2749,11 @@
 
         if needs_default_impl {
             let prefix = ctx.trait_prefix();
-            let body = if ctx.options().rust_features().maybe_uninit {
-                quote! {
-                    let mut s = ::#prefix::mem::MaybeUninit::<Self>::uninit();
-                    unsafe {
-                        ::#prefix::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-                        s.assume_init()
-                    }
-                }
-            } else {
-                quote! {
-                    unsafe {
-                        let mut s: Self = ::#prefix::mem::uninitialized();
-                        ::#prefix::ptr::write_bytes(&mut s, 0, 1);
-                        s
-                    }
+            let body = quote! {
+                let mut s = ::#prefix::mem::MaybeUninit::<Self>::uninit();
+                unsafe {
+                    ::#prefix::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+                    s.assume_init()
                 }
             };
             // Note we use `ptr::write_bytes()` instead of `mem::zeroed()` because the latter does
@@ -3096,24 +3074,11 @@
         // variable called `__bindgen_tmp` we're going to create.
         if self.is_constructor() {
             let prefix = ctx.trait_prefix();
-            let tmp_variable_decl = if ctx
-                .options()
-                .rust_features()
-                .maybe_uninit
-            {
-                exprs[0] = quote! {
-                    __bindgen_tmp.as_mut_ptr()
-                };
-                quote! {
-                    let mut __bindgen_tmp = ::#prefix::mem::MaybeUninit::uninit()
-                }
-            } else {
-                exprs[0] = quote! {
-                    &mut __bindgen_tmp
-                };
-                quote! {
-                    let mut __bindgen_tmp = ::#prefix::mem::uninitialized()
-                }
+            exprs[0] = quote! {
+                __bindgen_tmp.as_mut_ptr()
+            };
+            let tmp_variable_decl = quote! {
+                let mut __bindgen_tmp = ::#prefix::mem::MaybeUninit::uninit()
             };
             stmts.push(tmp_variable_decl);
         } else if !self.is_static() {
@@ -3130,14 +3095,8 @@
         stmts.push(call);
 
         if self.is_constructor() {
-            stmts.push(if ctx.options().rust_features().maybe_uninit {
-                quote! {
+            stmts.push(quote! {
                     __bindgen_tmp.assume_init()
-                }
-            } else {
-                quote! {
-                    __bindgen_tmp
-                }
             });
         }
 
@@ -5373,12 +5332,7 @@
             return;
         }
 
-        let bitfield_unit_src = if ctx.options().rust_features().raw_ref_macros
-        {
-            include_str!("./bitfield_unit_raw_ref_macros.rs")
-        } else {
-            include_str!("./bitfield_unit.rs")
-        };
+        let bitfield_unit_src = include_str!("./bitfield_unit.rs");
         let bitfield_unit_src = if true {
             Cow::Borrowed(bitfield_unit_src)
         } else {
diff --git a/bindgen/features.rs b/bindgen/features.rs
index 45ea893..04450bd 100644
--- a/bindgen/features.rs
+++ b/bindgen/features.rs
@@ -327,16 +327,8 @@
     Stable_1_71(71) => { c_unwind_abi: #106075 },
     Stable_1_68(68) => { abi_efiapi: #105795 },
     Stable_1_64(64) => { core_ffi_c: #94503 },
-    Stable_1_51(51) => {
-        raw_ref_macros: #80886,
-        min_const_generics: #74878,
-    },
     Stable_1_59(59) => { const_cstr: #54745 },
-    Stable_1_47(47) => { larger_arrays: #74060 },
-    Stable_1_43(43) => { associated_constants: #68952 },
-    Stable_1_40(40) => { non_exhaustive: #44109 },
-    Stable_1_36(36) => { maybe_uninit: #60445 },
-    Stable_1_33(33) => { repr_packed_n: #57049 },
+    Stable_1_51(51) => {},
 }
 
 /// Latest stable release of Rust that is supported by bindgen
@@ -477,11 +469,11 @@
     #[test]
     fn release_versions_for_editions() {
         assert_eq!(
-            "1.33".parse::<RustTarget>().unwrap().latest_edition(),
+            "1.51".parse::<RustTarget>().unwrap().latest_edition(),
             RustEdition::Edition2018
         );
         assert_eq!(
-            "1.56".parse::<RustTarget>().unwrap().latest_edition(),
+            "1.59".parse::<RustTarget>().unwrap().latest_edition(),
             RustEdition::Edition2021
         );
         assert_eq!(
diff --git a/bindgen/ir/analysis/derive.rs b/bindgen/ir/analysis/derive.rs
index eaa20ff..b1f167f 100644
--- a/bindgen/ir/analysis/derive.rs
+++ b/bindgen/ir/analysis/derive.rs
@@ -489,12 +489,8 @@
         }
     }
 
-    fn can_derive_large_array(self, ctx: &BindgenContext) -> bool {
-        if ctx.options().rust_features().larger_arrays {
-            !matches!(self, DeriveTrait::Default)
-        } else {
-            matches!(self, DeriveTrait::Copy)
-        }
+    fn can_derive_large_array(self, _: &BindgenContext) -> bool {
+        !matches!(self, DeriveTrait::Default)
     }
 
     fn can_derive_union(self) -> bool {
diff --git a/bindgen/ir/comp.rs b/bindgen/ir/comp.rs
index 0b50bf3..c67f9a2 100644
--- a/bindgen/ir/comp.rs
+++ b/bindgen/ir/comp.rs
@@ -1782,7 +1782,11 @@
 impl IsOpaque for CompInfo {
     type Extra = Option<Layout>;
 
-    fn is_opaque(&self, ctx: &BindgenContext, layout: &Option<Layout>) -> bool {
+    fn is_opaque(
+        &self,
+        ctx: &BindgenContext,
+        _layout: &Option<Layout>,
+    ) -> bool {
         if self.has_non_type_template_params ||
             self.has_unevaluable_bit_field_width
         {
@@ -1813,23 +1817,6 @@
             return true;
         }
 
-        if !ctx.options().rust_features().repr_packed_n {
-            // If we don't have `#[repr(packed(N)]`, the best we can
-            // do is make this struct opaque.
-            //
-            // See https://github.com/rust-lang/rust-bindgen/issues/537 and
-            // https://github.com/rust-lang/rust/issues/33158
-            if self.is_packed(ctx, layout.as_ref()) &&
-                layout.is_some_and(|l| l.align > 1)
-            {
-                warn!("Found a type that is both packed and aligned to greater than \
-                       1; Rust before version 1.33 doesn't have `#[repr(packed(N))]`, so we \
-                       are treating it as opaque. You may wish to set bindgen's rust target \
-                       version to 1.33 or later to enable `#[repr(packed(N))]` support.");
-                return true;
-            }
-        }
-
         false
     }
 }