Repository: rust-lang/rust-bindgen
Pull request #3008 (2024-11-30 19:43:00)

Consolidate dependency version management
* Consolidate MSRV management, and automate CI to pick it from the `Cargo.toml` instead of hardcoding
* Consolidate Rust language edition management
* Consolidate dependency management

With workspaces we can consolidate all dependency management in one location.  Even if dependency is used only once, we do not need to track if it is being used only once, plus we don't need to move things to a central places when more than one place uses it.  This keeps things much simpler, and ensures that every single dependency is listed in one location. 


Patch:
diff --git a/.github/workflows/bindgen.yml b/.github/workflows/bindgen.yml
index d1a11712..836052a5 100644
--- a/.github/workflows/bindgen.yml
+++ b/.github/workflows/bindgen.yml
@@ -37,25 +37,25 @@ jobs:
     steps:
       - uses: actions/checkout@v4
 
+      - name: Read crate metadata
+        id: metadata
+        run: echo "rust-version=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT
+
       - name: Install msrv for lib
         uses: dtolnay/rust-toolchain@master
         with:
-          # MSRV below is documented in Cargo.toml and README.md, please update those if you
-          # change this.
-          toolchain: 1.70.0
+          toolchain: ${{ steps.metadata.outputs.rust-version }}
 
       - name: Test lib with msrv
-        run: cargo +1.70.0 test --package bindgen
+        run: cargo +${{ steps.metadata.outputs.rust-version }} test --package bindgen
 
       - name: Install msrv for cli
         uses: dtolnay/rust-toolchain@master
         with:
-          # MSRV below is documented in Cargo.toml and README.md, please update those if you
-          # change this.
-          toolchain: 1.70.0
+          toolchain: ${{ steps.metadata.outputs.rust-version }}
 
       - name: Test cli with msrv
-        run: cargo +1.70.0 build --package bindgen-cli
+        run: cargo +${{ steps.metadata.outputs.rust-version }} build --package bindgen-cli
 
   minimal:
     runs-on: ubuntu-latest
diff --git a/Cargo.toml b/Cargo.toml
index 31c386bc..87b464aa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,11 +14,38 @@ default-members = [
     "bindgen-tests",
 ]
 
-# Dependencies shared between crates
+[workspace.package]
+# If you change this, also update README.md
+rust-version = "1.70.0"
+edition = "2021"
+
+# All dependency version management is centralized here
 [workspace.dependencies]
+annotate-snippets = "0.11.4"
+bindgen = { path = "./bindgen", default-features = false }
+bitflags = "2.2.1"
+block = "0.1"
+cc = "1.0"
+cexpr = "0.6"
+clang-sys = "1"
+clap = "4"
+clap_complete = "4"
+env_logger = "0.10.0"
+itertools = { version = ">=0.10,<0.14", default-features = false }
+libloading = "0.7"
+log = "0.4"
+objc = "0.2"
+owo-colors = "3.5.0"
+prettyplease = "0.2.7"
+proc-macro2 = "1"
+quickcheck = "1.0"
+quote = { version = "1", default-features = false }
+regex = { version = "1.5.3", default-features = false }
+rustc-hash = "1.0.1"
 shlex = "1"
-syn = "2.0" 
-proc-macro2 = { version = "1", default-features = false }
+similar = "2.2.1"
+syn = "2.0"
+tempfile = "3"
 
 # Config for 'cargo dist'
 [workspace.metadata.dist]
diff --git a/bindgen-cli/Cargo.toml b/bindgen-cli/Cargo.toml
index d6ab1b06..09a3f554 100644
--- a/bindgen-cli/Cargo.toml
+++ b/bindgen-cli/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 authors = [
-  "The rust-bindgen project contributors",
+    "The rust-bindgen project contributors",
 ]
 description = "Automatically generates Rust FFI bindings to C and C++ libraries."
 keywords = ["bindings", "ffi", "code-generation"]
@@ -12,18 +12,17 @@ repository = "https://github.com/rust-lang/rust-bindgen"
 documentation = "https://docs.rs/bindgen"
 homepage = "https://rust-lang.github.io/rust-bindgen/"
 version = "0.70.1"
-edition = "2021"
-rust-version = "1.70.0"
+rust-version.workspace = true
+edition.workspace = true
 
 [[bin]]
 path = "main.rs"
 name = "bindgen"
 
 [dependencies]
-bindgen = { path = "../bindgen", version = "=0.70.1",  default-features = false, features = ["__cli", "experimental", "prettyplease"] }
-env_logger = { version = "0.10.0", optional = true }
-log = { version = "0.4", optional = true }
-
+bindgen = { workspace = true, features = ["__cli", "experimental", "prettyplease"] }
+env_logger = { workspace = true, optional = true }
+log = { workspace = true, optional = true }
 proc-macro2.workspace = true
 shlex.workspace = true
 
diff --git a/bindgen-cli/main.rs b/bindgen-cli/main.rs
index 3eca487f..2d8d370e 100644
--- a/bindgen-cli/main.rs
+++ b/bindgen-cli/main.rs
@@ -35,7 +35,7 @@ pub fn main() {
 
             std::panic::set_hook(Box::new(move |info| {
                 if verbose {
-                    print_verbose_err()
+                    print_verbose_err();
                 }
                 eprintln!("{info}");
             }));
diff --git a/bindgen-integration/Cargo.toml b/bindgen-integration/Cargo.toml
index 38b52322..13bbcd09 100644
--- a/bindgen-integration/Cargo.toml
+++ b/bindgen-integration/Cargo.toml
@@ -4,12 +4,13 @@ description = "A package to test various bindgen features"
 version = "0.1.0"
 authors = ["Emilio Cobos Álvarez <emilio@crisal.io>"]
 publish = false
-edition = "2021"
 build = "build.rs"
+rust-version.workspace = true
+edition.workspace = true
 
 [build-dependencies]
-bindgen = { path = "../bindgen", features = ["experimental"] }
-cc = "1.0"
+bindgen = { workspace = true, default-features = true, features = ["experimental"] }
+cc.workspace = true
 
 [features]
 static = ["bindgen/static"]
diff --git a/bindgen/Cargo.toml b/bindgen/Cargo.toml
index 47462e17..dd4166de 100644
--- a/bindgen/Cargo.toml
+++ b/bindgen/Cargo.toml
@@ -1,9 +1,9 @@
 [package]
 authors = [
-  "Jyun-Yan You <jyyou.tw@gmail.com>",
-  "Emilio Cobos Álvarez <emilio@crisal.io>",
-  "Nick Fitzgerald <fitzgen@gmail.com>",
-  "The Servo project developers",
+    "Jyun-Yan You <jyyou.tw@gmail.com>",
+    "Emilio Cobos Álvarez <emilio@crisal.io>",
+    "Nick Fitzgerald <fitzgen@gmail.com>",
+    "The Servo project developers",
 ]
 description = "Automatically generates Rust FFI bindings to C and C++ libraries."
 keywords = ["bindings", "ffi", "code-generation"]
@@ -15,30 +15,28 @@ repository = "https://github.com/rust-lang/rust-bindgen"
 documentation = "https://docs.rs/bindgen"
 homepage = "https://rust-lang.github.io/rust-bindgen/"
 version = "0.70.1"
-edition = "2021"
 build = "build.rs"
-# If you change this, also update README.md and msrv in .github/workflows/bindgen.yml
-rust-version = "1.70.0"
+rust-version.workspace = true
+edition.workspace = true
 
 [lib]
 name = "bindgen"
 path = "lib.rs"
 
 [dependencies]
-annotate-snippets = { version = "0.11.4", optional = true }
-bitflags = "2.2.1"
-cexpr = "0.6"
-clang-sys = { version = "1", features = ["clang_11_0"] }
-clap = { version = "4", features = ["derive"], optional = true }
-clap_complete = { version = "4", optional = true}
-itertools = { version = ">=0.10,<0.14", default-features = false }
-log = { version = "0.4", optional = true }
-prettyplease = { version = "0.2.7", optional = true, features = ["verbatim"] }
-quote = { version = "1", default-features = false }
-regex = { version = "1.5.3", default-features = false, features = ["std", "unicode-perl"] }
-rustc-hash = "1.0.1"
-
+annotate-snippets = { workspace = true, optional = true }
+bitflags.workspace = true
+cexpr.workspace = true
+clang-sys = { workspace = true, features = ["clang_11_0"] }
+clap = { workspace = true, features = ["derive"], optional = true }
+clap_complete = { workspace = true, optional = true }
+itertools = { workspace = true }
+log = { workspace = true, optional = true }
+prettyplease = { workspace = true, optional = true, features = ["verbatim"] }
 proc-macro2.workspace = true
+quote.workspace = true
+regex = { workspace = true, features = ["std", "unicode-perl"] }
+rustc-hash.workspace = true
 shlex.workspace = true
 syn = { workspace = true, features = ["full", "extra-traits", "visit-mut"] }
 
diff --git a/bindgen/clang.rs b/bindgen/clang.rs
index 32eb8559..bca4a809 100644
--- a/bindgen/clang.rs
+++ b/bindgen/clang.rs
@@ -1066,7 +1066,7 @@ impl ClangToken {
             // expressions, so we strip them down here.
             CXToken_Comment => return None,
             _ => {
-                warn!("Found unexpected token kind: {:?}", self);
+                warn!("Found unexpected token kind: {self:?}");
                 return None;
             }
         };
@@ -1144,7 +1144,7 @@ impl Eq for Cursor {}
 
 impl Hash for Cursor {
     fn hash<H: Hasher>(&self, state: &mut H) {
-        unsafe { clang_hashCursor(self.x) }.hash(state)
+        unsafe { clang_hashCursor(self.x) }.hash(state);
     }
 }
 
@@ -2090,26 +2090,25 @@ pub(crate) fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
         let prefix = prefix.as_ref();
         print_indent(
             depth,
-            format!(" {}kind = {}", prefix, kind_to_str(c.kind())),
+            format!(" {prefix}kind = {}", kind_to_str(c.kind())),
         );
         print_indent(
             depth,
-            format!(" {}spelling = \"{}\"", prefix, c.spelling()),
+            format!(" {prefix}spelling = \"{}\"", c.spelling()),
         );
-        print_indent(depth, format!(" {}location = {}", prefix, c.location()));
+        print_indent(depth, format!(" {prefix}location = {}", c.location()));
         print_indent(
             depth,
-            format!(" {}is-definition? {}", prefix, c.is_definition()),
+            format!(" {prefix}is-definition? {}", c.is_definition()),
         );
         print_indent(
             depth,
-            format!(" {}is-declaration? {}", prefix, c.is_declaration()),
+            format!(" {prefix}is-declaration? {}", c.is_declaration()),
         );
         print_indent(
             depth,
             format!(
-                " {}is-inlined-function? {}",
-                prefix,
+                " {prefix}is-inlined-function? {}",
                 c.is_inlined_function()
             ),
         );
@@ -2118,11 +2117,7 @@ pub(crate) fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
         if templ_kind != CXCursor_NoDeclFound {
             print_indent(
                 depth,
-                format!(
-                    " {}template-kind = {}",
-                    prefix,
-                    kind_to_str(templ_kind)
-                ),
+                format!(" {prefix}template-kind = {}", kind_to_str(templ_kind)),
             );
         }
         if let Some(usr) = c.usr() {
@@ -2149,7 +2144,7 @@ pub(crate) fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
         if let Some(ty) = c.enum_type() {
             print_indent(
                 depth,
-                format!(" {}enum-type = {}", prefix, type_to_str(ty.kind())),
+                format!(" {prefix}enum-type = {}", type_to_str(ty.kind())),
             );
         }
         if let Some(val) = c.enum_val_signed() {
@@ -2158,13 +2153,13 @@ pub(crate) fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
         if let Some(ty) = c.typedef_type() {
             print_indent(
                 depth,
-                format!(" {}typedef-type = {}", prefix, type_to_str(ty.kind())),
+                format!(" {prefix}typedef-type = {}", type_to_str(ty.kind())),
             );
         }
         if let Some(ty) = c.ret_type() {
             print_indent(
                 depth,
-                format!(" {}ret-type = {}", prefix, type_to_str(ty.kind())),
+                format!(" {prefix}ret-type = {}", type_to_str(ty.kind())),
             );
         }
 
@@ -2214,16 +2209,16 @@ pub(crate) fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
         let prefix = prefix.as_ref();
 
         let kind = ty.kind();
-        print_indent(depth, format!(" {}kind = {}", prefix, type_to_str(kind)));
+        print_indent(depth, format!(" {prefix}kind = {}", type_to_str(kind)));
         if kind == CXType_Invalid {
             return;
         }
 
-        print_indent(depth, format!(" {}cconv = {}", prefix, ty.call_conv()));
+        print_indent(depth, format!(" {prefix}cconv = {}", ty.call_conv()));
 
         print_indent(
             depth,
-            format!(" {}spelling = \"{}\"", prefix, ty.spelling()),
+            format!(" {prefix}spelling = \"{}\"", ty.spelling()),
         );
         let num_template_args =
             unsafe { clang_Type_getNumTemplateArguments(ty.x) };
@@ -2240,7 +2235,7 @@ pub(crate) fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
         }
         print_indent(
             depth,
-            format!(" {}is-variadic? {}", prefix, ty.is_variadic()),
+            format!(" {prefix}is-variadic? {}", ty.is_variadic()),
         );
 
         let canonical = ty.canonical_type();
diff --git a/bindgen/codegen/helpers.rs b/bindgen/codegen/helpers.rs
index 89665380..abefeba3 100644
--- a/bindgen/codegen/helpers.rs
+++ b/bindgen/codegen/helpers.rs
@@ -19,7 +19,6 @@ pub(crate) mod attributes {
     pub(crate) fn repr_list(which_ones: &[&str]) -> TokenStream {
         let which_ones = which_ones
             .iter()
-            .cloned()
             .map(|one| TokenStream::from_str(one).expect("repr to be valid"));
         quote! {
             #[repr( #( #which_ones ),* )]
@@ -29,7 +28,6 @@ pub(crate) mod attributes {
     pub(crate) fn derives(which_ones: &[&str]) -> TokenStream {
         let which_ones = which_ones
             .iter()
-            .cloned()
             .map(|one| TokenStream::from_str(one).expect("derive to be valid"));
         quote! {
             #[derive( #( #which_ones ),* )]
@@ -355,7 +353,7 @@ pub(crate) mod ast_ty {
             return Ok(tokens);
         }
 
-        warn!("Unknown non-finite float number: {:?}", f);
+        warn!("Unknown non-finite float number: {f:?}");
         Err(())
     }
 
diff --git a/bindgen/codegen/impl_debug.rs b/bindgen/codegen/impl_debug.rs
index fd442254..b0e73b61 100644
--- a/bindgen/codegen/impl_debug.rs
+++ b/bindgen/codegen/impl_debug.rs
@@ -2,6 +2,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 std::fmt::Write as _;
 
 pub(crate) fn gen_debug_impl(
     ctx: &BindgenContext,
@@ -96,7 +97,7 @@ impl ImplDebug<'_> for BitfieldUnit {
             }
 
             if let Some(bitfield_name) = bitfield.name() {
-                format_string.push_str(&format!("{bitfield_name} : {{:?}}"));
+                let _ = write!(format_string, "{bitfield_name} : {{:?}}");
                 let getter_name = bitfield.getter_name();
                 let name_ident = ctx.rust_ident_raw(getter_name);
                 tokens.push(quote! {
diff --git a/bindgen/codegen/mod.rs b/bindgen/codegen/mod.rs
index 88809e2f..c58237c1 100644
--- a/bindgen/codegen/mod.rs
+++ b/bindgen/codegen/mod.rs
@@ -503,7 +503,7 @@ impl Item {
             // TODO(emilio, #453): Figure out what to do when this happens
             // legitimately, we could track the opaque stuff and disable the
             // assertion there I guess.
-            warn!("Found non-allowlisted item in code generation: {:?}", self);
+            warn!("Found non-allowlisted item in code generation: {self:?}");
         }
 
         result.set_seen(self.id());
@@ -521,7 +521,7 @@ impl CodeGenerator for Item {
         result: &mut CodegenResult<'_>,
         _extra: &(),
     ) {
-        debug!("<Item as CodeGenerator>::codegen: self = {:?}", self);
+        debug!("<Item as CodeGenerator>::codegen: self = {self:?}");
         if !self.process_before_codegen(ctx, result) {
             return;
         }
@@ -553,7 +553,7 @@ impl CodeGenerator for Module {
         result: &mut CodegenResult<'_>,
         item: &Item,
     ) {
-        debug!("<Module as CodeGenerator>::codegen: item = {:?}", item);
+        debug!("<Module as CodeGenerator>::codegen: item = {item:?}");
 
         let codegen_self = |result: &mut CodegenResult,
                             found_any: &mut bool| {
@@ -652,7 +652,7 @@ impl CodeGenerator for Var {
         item: &Item,
     ) {
         use crate::ir::var::VarType;
-        debug!("<Var as CodeGenerator>::codegen: item = {:?}", item);
+        debug!("<Var as CodeGenerator>::codegen: item = {item:?}");
         debug_assert!(item.is_enabled_for_codegen(ctx));
 
         let canonical_name = item.canonical_name(ctx);
@@ -829,7 +829,7 @@ impl CodeGenerator for Type {
         result: &mut CodegenResult<'_>,
         item: &Item,
     ) {
-        debug!("<Type as CodeGenerator>::codegen: item = {:?}", item);
+        debug!("<Type as CodeGenerator>::codegen: item = {item:?}");
         debug_assert!(item.is_enabled_for_codegen(ctx));
 
         match *self.kind() {
@@ -852,7 +852,7 @@ impl CodeGenerator for Type {
                 // it to BindgenContext::compute_allowlisted_and_codegen_items.
             }
             TypeKind::TemplateInstantiation(ref inst) => {
-                inst.codegen(ctx, result, item)
+                inst.codegen(ctx, result, item);
             }
             TypeKind::BlockPointer(inner) => {
                 if !ctx.options().generate_block {
@@ -927,16 +927,14 @@ impl CodeGenerator for Type {
                         assert_eq!(
                             layout.size,
                             ctx.target_pointer_size(),
-                            "Target platform requires `--no-size_t-is-usize`. The size of `{}` ({}) does not match the target pointer size ({})",
-                            spelling,
+                            "Target platform requires `--no-size_t-is-usize`. The size of `{spelling}` ({}) does not match the target pointer size ({})",
                             layout.size,
                             ctx.target_pointer_size(),
                             );
                         assert_eq!(
                             layout.align,
                             ctx.target_pointer_size(),
-                            "Target platform requires `--no-size_t-is-usize`. The alignment of `{}` ({}) does not match the target pointer size ({})",
-                            spelling,
+                            "Target platform requires `--no-size_t-is-usize`. The alignment of `{spelling}` ({}) does not match the target pointer size ({})",
                             layout.align,
                             ctx.target_pointer_size(),
                         );
@@ -1143,10 +1141,10 @@ impl CodeGenerator for Type {
                 result.saw_objc();
             }
             TypeKind::ObjCInterface(ref interface) => {
-                interface.codegen(ctx, result, item)
+                interface.codegen(ctx, result, item);
             }
             ref u @ TypeKind::UnresolvedTypeRef(..) => {
-                unreachable!("Should have been resolved after parsing {:?}!", u)
+                unreachable!("Should have been resolved after parsing {u:?}!")
             }
         }
     }
@@ -1230,7 +1228,7 @@ impl CodeGenerator for Vtable<'_> {
                 pub struct #name {
                     #( #methods ),*
                 }
-            })
+            });
         } else {
             // For the cases we don't support, simply generate an empty struct.
             let void = helpers::ast_ty::c_void(ctx);
@@ -2097,7 +2095,7 @@ impl CodeGenerator for CompInfo {
         result: &mut CodegenResult<'_>,
         item: &Item,
     ) {
-        debug!("<CompInfo as CodeGenerator>::codegen: item = {:?}", item);
+        debug!("<CompInfo as CodeGenerator>::codegen: item = {item:?}");
         debug_assert!(item.is_enabled_for_codegen(ctx));
 
         // Don't output classes with template parameters that aren't types, and
@@ -2323,7 +2321,7 @@ impl CodeGenerator for CompInfo {
                 let ty = helpers::blob(layout);
                 fields.push(quote! {
                     pub bindgen_union_field: #ty ,
-                })
+                });
             }
         }
 
@@ -2472,7 +2470,7 @@ impl CodeGenerator for CompInfo {
         derives.extend(custom_derives.iter().map(|s| s.as_str()));
 
         if !derives.is_empty() {
-            attributes.push(attributes::derives(&derives))
+            attributes.push(attributes::derives(&derives));
         }
 
         attributes.extend(
@@ -2531,10 +2529,7 @@ impl CodeGenerator for CompInfo {
         // affect layout, so we're bad and pray to the gods for avoid sending
         // all the tests to shit when parsing things like max_align_t.
         if self.found_unknown_attr() {
-            warn!(
-                "Type {} has an unknown attribute that may affect layout",
-                canonical_ident
-            );
+            warn!("Type {canonical_ident} has an unknown attribute that may affect layout");
         }
 
         if all_template_params.is_empty() {
@@ -3099,7 +3094,7 @@ impl Method {
                 quote! {
                     __bindgen_tmp
                 }
-            })
+            });
         }
 
         let block = ctx.wrap_unsafe_ops(quote! ( #( #stmts );*));
@@ -3544,7 +3539,7 @@ impl CodeGenerator for Enum {
         result: &mut CodegenResult<'_>,
         item: &Item,
     ) {
-        debug!("<Enum as CodeGenerator>::codegen: item = {:?}", item);
+        debug!("<Enum as CodeGenerator>::codegen: item = {item:?}");
         debug_assert!(item.is_enabled_for_codegen(ctx));
 
         let name = item.canonical_name(ctx);
@@ -3600,8 +3595,7 @@ impl CodeGenerator for Enum {
                     (false, 8) => IntKind::U64,
                     _ => {
                         warn!(
-                            "invalid enum decl: signed: {}, size: {}",
-                            signed, size
+                            "invalid enum decl: signed: {signed}, size: {size}"
                         );
                         IntKind::I32
                     }
@@ -4355,7 +4349,7 @@ impl TryToRustTy for Type {
                 Ok(syn::parse_quote! { #name })
             }
             ref u @ TypeKind::UnresolvedTypeRef(..) => {
-                unreachable!("Should have been resolved after parsing {:?}!", u)
+                unreachable!("Should have been resolved after parsing {u:?}!")
             }
         }
     }
@@ -4487,7 +4481,7 @@ impl CodeGenerator for Function {
         result: &mut CodegenResult<'_>,
         item: &Item,
     ) -> Self::Return {
-        debug!("<Function as CodeGenerator>::codegen: item = {:?}", item);
+        debug!("<Function as CodeGenerator>::codegen: item = {item:?}");
         debug_assert!(item.is_enabled_for_codegen(ctx));
 
         let is_internal = matches!(self.linkage(), Linkage::Internal);
@@ -4718,10 +4712,8 @@ fn unsupported_abi_diagnostic(
     error: &error::Error,
 ) {
     warn!(
-        "Skipping {}function `{}` because the {}",
+        "Skipping {}function `{fn_name}` because the {error}",
         if variadic { "variadic " } else { "" },
-        fn_name,
-        error
     );
 
     #[cfg(feature = "experimental")]
@@ -4731,10 +4723,8 @@ fn unsupported_abi_diagnostic(
         let mut diag = Diagnostic::default();
         diag.with_title(
             format!(
-                "Skipping {}function `{}` because the {}",
+                "Skipping {}function `{fn_name}` because the {error}",
                 if variadic { "variadic " } else { "" },
-                fn_name,
-                error
             ),
             Level::Warning,
         )
@@ -4764,7 +4754,7 @@ fn unsupported_abi_diagnostic(
             }
         }
 
-        diag.display()
+        diag.display();
     }
 }
 
@@ -4774,8 +4764,7 @@ fn variadic_fn_diagnostic(
     _ctx: &BindgenContext,
 ) {
     warn!(
-        "Cannot generate wrapper for the static variadic function `{}`.",
-        fn_name,
+        "Cannot generate wrapper for the static variadic function `{fn_name}`."
     );
 
     #[cfg(feature = "experimental")]
@@ -4802,7 +4791,7 @@ fn variadic_fn_diagnostic(
             }
         }
 
-        diag.display()
+        diag.display();
     }
 }
 
@@ -4817,7 +4806,7 @@ fn objc_method_codegen(
     // This would ideally resolve the method into an Item, and use
     // Item::process_before_codegen; however, ObjC methods are not currently
     // made into function items.
-    let name = format!("{}::{}{}", rust_class_name, prefix, method.rust_name());
+    let name = format!("{rust_class_name}::{prefix}{}", method.rust_name());
     if ctx.options().blocklisted_items.matches(name) {
         return;
     }
@@ -4854,8 +4843,7 @@ fn objc_method_codegen(
         ctx.wrap_unsafe_ops(body)
     };
 
-    let method_name =
-        ctx.rust_ident(format!("{}{}", prefix, method.rust_name()));
+    let method_name = ctx.rust_ident(format!("{prefix}{}", method.rust_name()));
 
     methods.push(quote! {
         unsafe fn #method_name #sig where <Self as std::ops::Deref>::Target: objc::Message + Sized {
@@ -5095,10 +5083,9 @@ pub(crate) fn codegen(
         if let Some(path) = context.options().emit_ir_graphviz.as_ref() {
             match dot::write_dot_file(context, path) {
                 Ok(()) => info!(
-                    "Your dot file was generated successfully into: {}",
-                    path
+                    "Your dot file was generated successfully into: {path}"
                 ),
-                Err(e) => warn!("{}", e),
+                Err(e) => warn!("{e}"),
             }
         }
 
@@ -5108,7 +5095,7 @@ pub(crate) fn codegen(
                     "Your depfile was generated successfully into: {}",
                     spec.depfile_path.display()
                 ),
-                Err(e) => warn!("{}", e),
+                Err(e) => warn!("{e}"),
             }
         }
 
@@ -5234,10 +5221,10 @@ pub(crate) mod utils {
                     }
                     match ty.kind() {
                         TypeKind::Alias(type_id_alias) => {
-                            type_id = *type_id_alias
+                            type_id = *type_id_alias;
                         }
                         TypeKind::ResolvedTypeRef(type_id_typedef) => {
-                            type_id = *type_id_typedef
+                            type_id = *type_id_typedef;
                         }
                         _ => break,
                     }
@@ -5718,7 +5705,7 @@ pub(crate) mod utils {
             .collect::<Vec<_>>();
 
         if is_variadic {
-            args.push(quote! { ... })
+            args.push(quote! { ... });
         }
 
         args
diff --git a/bindgen/codegen/postprocessing/merge_extern_blocks.rs b/bindgen/codegen/postprocessing/merge_extern_blocks.rs
index 10fa0ec8..e0f6a34b 100644
--- a/bindgen/codegen/postprocessing/merge_extern_blocks.rs
+++ b/bindgen/codegen/postprocessing/merge_extern_blocks.rs
@@ -4,7 +4,7 @@ use syn::{
 };
 
 pub(super) fn merge_extern_blocks(file: &mut File) {
-    Visitor.visit_file_mut(file)
+    Visitor.visit_file_mut(file);
 }
 
 struct Visitor;
@@ -12,14 +12,14 @@ struct Visitor;
 impl VisitMut for Visitor {
     fn visit_file_mut(&mut self, file: &mut File) {
         visit_items(&mut file.items);
-        visit_file_mut(self, file)
+        visit_file_mut(self, file);
     }
 
     fn visit_item_mod_mut(&mut self, item_mod: &mut ItemMod) {
         if let Some((_, ref mut items)) = item_mod.content {
             visit_items(items);
         }
-        visit_item_mod_mut(self, item_mod)
+        visit_item_mod_mut(self, item_mod);
     }
 }
 
diff --git a/bindgen/codegen/postprocessing/sort_semantically.rs b/bindgen/codegen/postprocessing/sort_semantically.rs
index be94ce69..e9bb5dc3 100644
--- a/bindgen/codegen/postprocessing/sort_semantically.rs
+++ b/bindgen/codegen/postprocessing/sort_semantically.rs
@@ -4,7 +4,7 @@ use syn::{
 };
 
 pub(super) fn sort_semantically(file: &mut File) {
-    Visitor.visit_file_mut(file)
+    Visitor.visit_file_mut(file);
 }
 
 struct Visitor;
@@ -12,14 +12,14 @@ struct Visitor;
 impl VisitMut for Visitor {
     fn visit_file_mut(&mut self, file: &mut File) {
         visit_items(&mut file.items);
-        visit_file_mut(self, file)
+        visit_file_mut(self, file);
     }
 
     fn visit_item_mod_mut(&mut self, item_mod: &mut ItemMod) {
         if let Some((_, ref mut items)) = item_mod.content {
             visit_items(items);
         }
-        visit_item_mod_mut(self, item_mod)
+        visit_item_mod_mut(self, item_mod);
     }
 }
 
diff --git a/bindgen/codegen/serialize.rs b/bindgen/codegen/serialize.rs
index 7f25c28d..864d86b4 100644
--- a/bindgen/codegen/serialize.rs
+++ b/bindgen/codegen/serialize.rs
@@ -114,7 +114,7 @@ impl<'a> CSerialize<'a> for Function {
         };
 
         // The name used for the wrapper self.
-        let wrap_name = format!("{}{}", name, ctx.wrap_static_fns_suffix());
+        let wrap_name = format!("{name}{}", ctx.wrap_static_fns_suffix());
 
         // The function's return type
         let (ret_item, ret_ty) = {
@@ -228,13 +228,13 @@ impl<'a> CSerialize<'a> for Type {
                 if self.is_const() {
                     write!(writer, "const ")?;
                 }
-                write!(writer, "void")?
+                write!(writer, "void")?;
             }
             TypeKind::NullPtr => {
                 if self.is_const() {
                     write!(writer, "const ")?;
                 }
-                write!(writer, "nullptr_t")?
+                write!(writer, "nullptr_t")?;
             }
             TypeKind::Int(int_kind) => {
                 if self.is_const() {
@@ -285,7 +285,7 @@ impl<'a> CSerialize<'a> for Type {
                     FloatKind::Float => write!(writer, "float complex")?,
                     FloatKind::Double => write!(writer, "double complex")?,
                     FloatKind::LongDouble => {
-                        write!(writer, "long double complex")?
+                        write!(writer, "long double complex")?;
                     }
                     FloatKind::Float128 => write!(writer, "__complex128")?,
                 }
@@ -303,7 +303,7 @@ impl<'a> CSerialize<'a> for Type {
             }
             TypeKind::Array(type_id, length) => {
                 type_id.serialize(ctx, (), stack, writer)?;
-                write!(writer, " [{length}]")?
+                write!(writer, " [{length}]")?;
             }
             TypeKind::Function(signature) => {
                 if self.is_const() {
@@ -341,14 +341,14 @@ impl<'a> CSerialize<'a> for Type {
                             type_id.serialize(ctx, (), &mut stack, buf)
                         },
                     )?;
-                    write!(writer, ")")?
+                    write!(writer, ")")?;
                 }
             }
             TypeKind::ResolvedTypeRef(type_id) => {
                 if self.is_const() {
                     write!(writer, "const ")?;
                 }
-                type_id.serialize(ctx, (), stack, writer)?
+                type_id.serialize(ctx, (), stack, writer)?;
             }
             TypeKind::Pointer(type_id) => {
                 if self.is_const() {
@@ -356,7 +356,7 @@ impl<'a> CSerialize<'a> for Type {
                 } else {
                     stack.push("*".to_owned());
                 }
-                type_id.serialize(ctx, (), stack, writer)?
+                type_id.serialize(ctx, (), stack, writer)?;
             }
             TypeKind::Comp(comp_info) => {
                 if self.is_const() {
diff --git a/bindgen/codegen/struct_layout.rs b/bindgen/codegen/struct_layout.rs
index e3235dd8..40edefd5 100644
--- a/bindgen/codegen/struct_layout.rs
+++ b/bindgen/codegen/struct_layout.rs
@@ -148,7 +148,7 @@ impl<'a> StructLayoutTracker<'a> {
     }
 
     pub(crate) fn saw_bitfield_unit(&mut self, layout: Layout) {
-        debug!("saw bitfield unit for {}: {:?}", self.name, layout);
+        debug!("saw bitfield unit for {}: {layout:?}", self.name);
 
         self.align_to_latest_field(layout);
 
@@ -248,12 +248,9 @@ impl<'a> StructLayoutTracker<'a> {
             );
 
             debug!(
-                "align field {} to {}/{} with {} padding bytes {:?}",
-                field_name,
+                "align field {field_name} to {}/{} with {padding_bytes} padding bytes {field_layout:?}",
                 self.latest_offset,
                 field_offset.unwrap_or(0) / 8,
-                padding_bytes,
-                field_layout
             );
 
             let padding_align = if force_padding {
@@ -276,8 +273,7 @@ impl<'a> StructLayoutTracker<'a> {
         self.last_field_was_bitfield = false;
 
         debug!(
-            "Offset: {}: {} -> {}",
-            field_name,
+            "Offset: {field_name}: {} -> {}",
             self.latest_offset - field_layout.size,
             self.latest_offset
         );
@@ -312,8 +308,7 @@ impl<'a> StructLayoutTracker<'a> {
         }
 
         trace!(
-            "need a tail padding field for {}: offset {} -> size {}",
-            comp_name,
+            "need a tail padding field for {comp_name}: offset {} -> size {}",
             self.latest_offset,
             comp_layout.size
         );
@@ -325,10 +320,7 @@ impl<'a> StructLayoutTracker<'a> {
         &mut self,
         layout: Layout,
     ) -> Option<proc_macro2::TokenStream> {
-        debug!(
-            "pad_struct:\n\tself = {:#?}\n\tlayout = {:#?}",
-            self, layout
-        );
+        debug!("pad_struct:\n\tself = {self:#?}\n\tlayout = {layout:#?}");
 
         if layout.size < self.latest_offset {
             warn!(
@@ -368,7 +360,7 @@ impl<'a> StructLayoutTracker<'a> {
                 Layout::new(padding_bytes, layout.align)
             };
 
-            debug!("pad bytes to struct {}, {:?}", self.name, layout);
+            debug!("pad bytes to struct {}, {layout:?}", self.name);
 
             Some(self.padding_field(layout))
         } else {
@@ -437,8 +429,8 @@ impl<'a> StructLayoutTracker<'a> {
         // If it was, we may or may not need to align, depending on what the
         // current field alignment and the bitfield size and alignment are.
         debug!(
-            "align_to_bitfield? {}: {:?} {:?}",
-            self.last_field_was_bitfield, layout, new_field_layout
+            "align_to_bitfield? {}: {layout:?} {new_field_layout:?}",
+            self.last_field_was_bitfield,
         );
 
         // Avoid divide-by-zero errors if align is 0.
diff --git a/bindgen/deps.rs b/bindgen/deps.rs
index be31f928..3f95ac1e 100644
--- a/bindgen/deps.rs
+++ b/bindgen/deps.rs
@@ -18,7 +18,7 @@ impl DepfileSpec {
 
         let mut buf = format!("{}:", escape(&self.output_module));
         for file in deps {
-            buf = format!("{} {}", buf, escape(file));
+            buf = format!("{buf} {}", escape(file));
         }
         buf
     }
diff --git a/bindgen/features.rs b/bindgen/features.rs
index b018354e..af36ffca 100644
--- a/bindgen/features.rs
+++ b/bindgen/features.rs
@@ -83,6 +83,7 @@ impl fmt::Display for InvalidRustTarget {
 macro_rules! define_rust_editions {
     ($($variant:ident($value:literal) => $minor:literal,)*) => {
         #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
+        #[doc = "Represents Rust Edition for the generated bindings"]
         pub enum RustEdition {
             $(
                 #[doc = concat!("The ", stringify!($value), " edition of Rust.")]
diff --git a/bindgen/ir/analysis/derive.rs b/bindgen/ir/analysis/derive.rs
index d333a048..ef063e18 100644
--- a/bindgen/ir/analysis/derive.rs
+++ b/bindgen/ir/analysis/derive.rs
@@ -112,10 +112,8 @@ impl CannotDerive<'_> {
     ) -> ConstrainResult {
         let id = id.into();
         trace!(
-            "inserting {:?} can_derive<{}>={:?}",
-            id,
+            "inserting {id:?} can_derive<{}>={can_derive:?}",
             self.derive_trait,
-            can_derive
         );
 
         if let CanDerive::Yes = can_derive {
@@ -168,7 +166,7 @@ impl CannotDerive<'_> {
             return CanDerive::No;
         }
 
-        trace!("ty: {:?}", ty);
+        trace!("ty: {ty:?}");
         if item.is_opaque(self.ctx, &()) {
             if !self.derive_trait.can_derive_union() &&
                 ty.is_union() &&
@@ -234,7 +232,7 @@ impl CannotDerive<'_> {
             // Complex cases need more information
             TypeKind::Array(t, len) => {
                 let inner_type =
-                    self.can_derive.get(&t.into()).cloned().unwrap_or_default();
+                    self.can_derive.get(&t.into()).copied().unwrap_or_default();
                 if inner_type != CanDerive::Yes {
                     trace!(
                         "    arrays of T for which we cannot derive {} \
@@ -273,7 +271,7 @@ impl CannotDerive<'_> {
             }
             TypeKind::Vector(t, len) => {
                 let inner_type =
-                    self.can_derive.get(&t.into()).cloned().unwrap_or_default();
+                    self.can_derive.get(&t.into()).copied().unwrap_or_default();
                 if inner_type != CanDerive::Yes {
                     trace!(
                         "    vectors of T for which we cannot derive {} \
@@ -428,13 +426,13 @@ impl CannotDerive<'_> {
 
                 let can_derive = self.can_derive
                     .get(&sub_id)
-                    .cloned()
+                    .copied()
                     .unwrap_or_default();
 
                 match can_derive {
-                    CanDerive::Yes => trace!("    member {:?} can derive {}", sub_id, self.derive_trait),
-                    CanDerive::Manually => trace!("    member {:?} cannot derive {}, but it may be implemented", sub_id, self.derive_trait),
-                    CanDerive::No => trace!("    member {:?} cannot derive {}", sub_id, self.derive_trait),
+                    CanDerive::Yes => trace!("    member {sub_id:?} can derive {}", self.derive_trait),
+                    CanDerive::Manually => trace!("    member {sub_id:?} cannot derive {}, but it may be implemented", self.derive_trait),
+                    CanDerive::No => trace!("    member {sub_id:?} cannot derive {}", self.derive_trait),
                 }
 
                 *candidate.get_or_insert(CanDerive::Yes) |= can_derive;
@@ -527,15 +525,15 @@ impl DeriveTrait {
     fn can_derive_fnptr(&self, f: &FunctionSig) -> CanDerive {
         match (self, f.function_pointers_can_derive()) {
             (DeriveTrait::Copy, _) | (DeriveTrait::Default, _) | (_, true) => {
-                trace!("    function pointer can derive {}", self);
+                trace!("    function pointer can derive {self}");
                 CanDerive::Yes
             }
             (DeriveTrait::Debug, false) => {
-                trace!("    function pointer cannot derive {}, but it may be implemented", self);
+                trace!("    function pointer cannot derive {self}, but it may be implemented");
                 CanDerive::Manually
             }
             (_, false) => {
-                trace!("    function pointer cannot derive {}", self);
+                trace!("    function pointer cannot derive {self}");
                 CanDerive::No
             }
         }
@@ -551,7 +549,7 @@ impl DeriveTrait {
                 CanDerive::No
             }
             _ => {
-                trace!("    vector can derive {}", self);
+                trace!("    vector can derive {self}");
                 CanDerive::Yes
             }
         }
@@ -564,7 +562,7 @@ impl DeriveTrait {
                 CanDerive::No
             }
             _ => {
-                trace!("    pointer can derive {}", self);
+                trace!("    pointer can derive {self}");
                 CanDerive::Yes
             }
         }
@@ -597,7 +595,7 @@ impl DeriveTrait {
             }
             // === others ===
             _ => {
-                trace!("    simple type that can always derive {}", self);
+                trace!("    simple type that can always derive {self}");
                 CanDerive::Yes
             }
         }
@@ -642,7 +640,7 @@ impl<'ctx> MonotoneFramework for CannotDerive<'ctx> {
         self.ctx
             .allowlisted_items()
             .iter()
-            .cloned()
+            .copied()
             .flat_map(|i| {
                 let mut reachable = vec![i];
                 i.trace(
@@ -658,9 +656,9 @@ impl<'ctx> MonotoneFramework for CannotDerive<'ctx> {
     }
 
     fn constrain(&mut self, id: ItemId) -> ConstrainResult {
-        trace!("constrain: {:?}", id);
+        trace!("constrain: {id:?}");
 
-        if let Some(CanDerive::No) = self.can_derive.get(&id).cloned() {
+        if let Some(CanDerive::No) = self.can_derive.get(&id) {
             trace!("    already know it cannot derive {}", self.derive_trait);
             return ConstrainResult::Same;
         }
@@ -697,7 +695,7 @@ impl<'ctx> MonotoneFramework for CannotDerive<'ctx> {
     {
         if let Some(edges) = self.dependencies.get(&id) {
             for item in edges {
-                trace!("enqueue {:?} into worklist", item);
+                trace!("enqueue {item:?} into worklist");
                 f(*item);
             }
         }
diff --git a/bindgen/ir/analysis/has_destructor.rs b/bindgen/ir/analysis/has_destructor.rs
index 2f5cf112..4893f8f8 100644
--- a/bindgen/ir/analysis/has_destructor.rs
+++ b/bindgen/ir/analysis/has_destructor.rs
@@ -82,7 +82,7 @@ impl<'ctx> MonotoneFramework for HasDestructorAnalysis<'ctx> {
     }
 
     fn initial_worklist(&self) -> Vec<ItemId> {
-        self.ctx.allowlisted_items().iter().cloned().collect()
+        self.ctx.allowlisted_items().iter().copied().collect()
     }
 
     fn constrain(&mut self, id: ItemId) -> ConstrainResult {
@@ -161,7 +161,7 @@ impl<'ctx> MonotoneFramework for HasDestructorAnalysis<'ctx> {
     {
         if let Some(edges) = self.dependencies.get(&id) {
             for item in edges {
-                trace!("enqueue {:?} into worklist", item);
+                trace!("enqueue {item:?} into worklist");
                 f(*item);
             }
         }
diff --git a/bindgen/ir/analysis/has_float.rs b/bindgen/ir/analysis/has_float.rs
index 75778ba7..630458e5 100644
--- a/bindgen/ir/analysis/has_float.rs
+++ b/bindgen/ir/analysis/has_float.rs
@@ -63,7 +63,7 @@ impl HasFloat<'_> {
 
     fn insert<Id: Into<ItemId>>(&mut self, id: Id) -> ConstrainResult {
         let id = id.into();
-        trace!("inserting {:?} into the has_float set", id);
+        trace!("inserting {id:?} into the has_float set");
 
         let was_not_already_in_set = self.has_float.insert(id);
         assert!(
@@ -93,11 +93,11 @@ impl<'ctx> MonotoneFramework for HasFloat<'ctx> {
     }
 
     fn initial_worklist(&self) -> Vec<ItemId> {
-        self.ctx.allowlisted_items().iter().cloned().collect()
+        self.ctx.allowlisted_items().iter().copied().collect()
     }
 
     fn constrain(&mut self, id: ItemId) -> ConstrainResult {
-        trace!("constrain: {:?}", id);
+        trace!("constrain: {id:?}");
 
         if self.has_float.contains(&id) {
             trace!("    already know it do not have float");
@@ -209,7 +209,7 @@ impl<'ctx> MonotoneFramework for HasFloat<'ctx> {
                 if args_have {
                     trace!(
                         "    template args have float, so \
-                         insantiation also has float"
+                         instantiation also has float"
                     );
                     return self.insert(id);
                 }
@@ -220,7 +220,7 @@ impl<'ctx> MonotoneFramework for HasFloat<'ctx> {
                 if def_has {
                     trace!(
                         "    template definition has float, so \
-                         insantiation also has"
+                         instantiation also has"
                     );
                     return self.insert(id);
                 }
@@ -237,7 +237,7 @@ impl<'ctx> MonotoneFramework for HasFloat<'ctx> {
     {
         if let Some(edges) = self.dependencies.get(&id) {
             for item in edges {
-                trace!("enqueue {:?} into worklist", item);
+                trace!("enqueue {item:?} into worklist");
                 f(*item);
             }
         }
diff --git a/bindgen/ir/analysis/has_type_param_in_array.rs b/bindgen/ir/analysis/has_type_param_in_array.rs
index 2ac378bf..61a8d631 100644
--- a/bindgen/ir/analysis/has_type_param_in_array.rs
+++ b/bindgen/ir/analysis/has_type_param_in_array.rs
@@ -65,10 +65,7 @@ impl HasTypeParameterInArray<'_> {
 
     fn insert<Id: Into<ItemId>>(&mut self, id: Id) -> ConstrainResult {
         let id = id.into();
-        trace!(
-            "inserting {:?} into the has_type_parameter_in_array set",
-            id
-        );
+        trace!("inserting {id:?} into the has_type_parameter_in_array set");
 
         let was_not_already_in_set =
             self.has_type_parameter_in_array.insert(id);
@@ -99,11 +96,11 @@ impl<'ctx> MonotoneFramework for HasTypeParameterInArray<'ctx> {
     }
 
     fn initial_worklist(&self) -> Vec<ItemId> {
-        self.ctx.allowlisted_items().iter().cloned().collect()
+        self.ctx.allowlisted_items().iter().copied().collect()
     }
 
     fn constrain(&mut self, id: ItemId) -> ConstrainResult {
-        trace!("constrain: {:?}", id);
+        trace!("constrain: {id:?}");
 
         if self.has_type_parameter_in_array.contains(&id) {
             trace!("    already know it do not have array");
@@ -209,7 +206,7 @@ impl<'ctx> MonotoneFramework for HasTypeParameterInArray<'ctx> {
                 if args_have {
                     trace!(
                         "    template args have array, so \
-                         insantiation also has array"
+                         instantiation also has array"
                     );
                     return self.insert(id);
                 }
@@ -220,7 +217,7 @@ impl<'ctx> MonotoneFramework for HasTypeParameterInArray<'ctx> {
                 if def_has {
                     trace!(
                         "    template definition has array, so \
-                         insantiation also has"
+                         instantiation also has"
                     );
                     return self.insert(id);
                 }
@@ -237,7 +234,7 @@ impl<'ctx> MonotoneFramework for HasTypeParameterInArray<'ctx> {
     {
         if let Some(edges) = self.dependencies.get(&id) {
             for item in edges {
-                trace!("enqueue {:?} into worklist", item);
+                trace!("enqueue {item:?} into worklist");
                 f(*item);
             }
         }
diff --git a/bindgen/ir/analysis/has_vtable.rs b/bindgen/ir/analysis/has_vtable.rs
index 1f1c46ff..0953df6e 100644
--- a/bindgen/ir/analysis/has_vtable.rs
+++ b/bindgen/ir/analysis/has_vtable.rs
@@ -40,7 +40,7 @@ impl ops::BitOr for HasVtableResult {
 
 impl ops::BitOrAssign for HasVtableResult {
     fn bitor_assign(&mut self, rhs: HasVtableResult) {
-        *self = self.join(rhs)
+        *self = self.join(rhs);
     }
 }
 
@@ -118,9 +118,9 @@ impl HasVtableAnalysis<'_> {
         let from = from.into();
         let to = to.into();
 
-        match self.have_vtable.get(&from).cloned() {
+        match self.have_vtable.get(&from) {
             None => ConstrainResult::Same,
-            Some(r) => self.insert(to, r),
+            Some(r) => self.insert(to, *r),
         }
     }
 }
@@ -142,11 +142,11 @@ impl<'ctx> MonotoneFramework for HasVtableAnalysis<'ctx> {
     }
 
     fn initial_worklist(&self) -> Vec<ItemId> {
-        self.ctx.allowlisted_items().iter().cloned().collect()
+        self.ctx.allowlisted_items().iter().copied().collect()
     }
 
     fn constrain(&mut self, id: ItemId) -> ConstrainResult {
-        trace!("constrain {:?}", id);
+        trace!("constrain {id:?}");
 
         let item = self.ctx.resolve_item(id);
         let ty = match item.as_type() {
@@ -176,7 +176,7 @@ impl<'ctx> MonotoneFramework for HasVtableAnalysis<'ctx> {
                 }
 
                 let bases_has_vtable = info.base_members().iter().any(|base| {
-                    trace!("    comp has a base with a vtable: {:?}", base);
+                    trace!("    comp has a base with a vtable: {base:?}");
                     self.have_vtable.contains_key(&base.ty.into())
                 });
                 if bases_has_vtable {
@@ -200,7 +200,7 @@ impl<'ctx> MonotoneFramework for HasVtableAnalysis<'ctx> {
     {
         if let Some(edges) = self.dependencies.get(&id) {
             for item in edges {
-                trace!("enqueue {:?} into worklist", item);
+                trace!("enqueue {item:?} into worklist");
                 f(*item);
             }
         }
diff --git a/bindgen/ir/analysis/mod.rs b/bindgen/ir/analysis/mod.rs
index b40a66cc..731080cb 100644
--- a/bindgen/ir/analysis/mod.rs
+++ b/bindgen/ir/analysis/mod.rs
@@ -316,7 +316,7 @@ mod tests {
         }
 
         fn initial_worklist(&self) -> Vec<Node> {
-            self.graph.0.keys().cloned().collect()
+            self.graph.0.keys().copied().collect()
         }
 
         fn constrain(&mut self, node: Node) -> ConstrainResult {
@@ -376,7 +376,7 @@ mod tests {
         where
             A: AsRef<[usize]>,
         {
-            nodes.as_ref().iter().cloned().map(Node).collect()
+            nodes.as_ref().iter().copied().map(Node).collect()
         }
 
         let mut expected = HashMap::default();
diff --git a/bindgen/ir/analysis/sizedness.rs b/bindgen/ir/analysis/sizedness.rs
index 4dc52fac..ce3c2c3d 100644
--- a/bindgen/ir/analysis/sizedness.rs
+++ b/bindgen/ir/analysis/sizedness.rs
@@ -80,7 +80,7 @@ impl ops::BitOr for SizednessResult {
 
 impl ops::BitOrAssign for SizednessResult {
     fn bitor_assign(&mut self, rhs: SizednessResult) {
-        *self = self.join(rhs)
+        *self = self.join(rhs);
     }
 }
 
@@ -127,7 +127,7 @@ impl SizednessAnalysis<'_> {
         id: TypeId,
         result: SizednessResult,
     ) -> ConstrainResult {
-        trace!("inserting {:?} for {:?}", result, id);
+        trace!("inserting {result:?} for {id:?}");
 
         if let SizednessResult::ZeroSized = result {
             return ConstrainResult::Same;
@@ -150,9 +150,9 @@ impl SizednessAnalysis<'_> {
     }
 
     fn forward(&mut self, from: TypeId, to: TypeId) -> ConstrainResult {
-        match self.sized.get(&from).cloned() {
+        match self.sized.get(&from) {
             None => ConstrainResult::Same,
-            Some(r) => self.insert(to, r),
+            Some(r) => self.insert(to, *r),
         }
     }
 }
@@ -191,17 +191,14 @@ impl<'ctx> MonotoneFramework for SizednessAnalysis<'ctx> {
         self.ctx
             .allowlisted_items()
             .iter()
-            .cloned()
             .filter_map(|id| id.as_type_id(self.ctx))
             .collect()
     }
 
     fn constrain(&mut self, id: TypeId) -> ConstrainResult {
-        trace!("constrain {:?}", id);
+        trace!("constrain {id:?}");
 
-        if let Some(SizednessResult::NonZeroSized) =
-            self.sized.get(&id).cloned()
-        {
+        if let Some(SizednessResult::NonZeroSized) = self.sized.get(&id) {
             trace!("    already know it is not zero-sized");
             return ConstrainResult::Same;
         }
@@ -322,7 +319,7 @@ impl<'ctx> MonotoneFramework for SizednessAnalysis<'ctx> {
     {
         if let Some(edges) = self.dependencies.get(&id) {
             for ty in edges {
-                trace!("enqueue {:?} into worklist", ty);
+                trace!("enqueue {ty:?} into worklist");
                 f(*ty);
             }
         }
diff --git a/bindgen/ir/analysis/template_params.rs b/bindgen/ir/analysis/template_params.rs
index 4015fb17..778a515d 100644
--- a/bindgen/ir/analysis/template_params.rs
+++ b/bindgen/ir/analysis/template_params.rs
@@ -259,7 +259,6 @@ impl UsedTemplateParameters<'_> {
                          a's used template param set should be `Some`",
                     )
                     .iter()
-                    .cloned()
             });
 
         used_by_this_id.extend(args);
@@ -291,10 +290,8 @@ impl UsedTemplateParameters<'_> {
 
         for (arg, param) in args.iter().zip(params.iter()) {
             trace!(
-                "      instantiation's argument {:?} is used if definition's \
-                 parameter {:?} is used",
-                arg,
-                param
+                "      instantiation's argument {arg:?} is used if definition's \
+                 parameter {param:?} is used",
             );
 
             if used_by_def.contains(&param.into()) {
@@ -322,8 +319,7 @@ impl UsedTemplateParameters<'_> {
                          arg's used template param set should be \
                          `Some`",
                     )
-                    .iter()
-                    .cloned();
+                    .iter();
                 used_by_this_id.extend(used_by_arg);
             }
         }
@@ -355,12 +351,10 @@ impl UsedTemplateParameters<'_> {
                          sub_id's used template param set should be \
                          `Some`",
                     )
-                    .iter()
-                    .cloned();
+                    .iter();
 
                 trace!(
-                    "      union with {:?}'s usage: {:?}",
-                    sub_id,
+                    "      union with {sub_id:?}'s usage: {:?}",
                     used_by_sub_id.clone().collect::<Vec<_>>()
                 );
 
@@ -380,11 +374,11 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
         let mut used = HashMap::default();
         let mut dependencies = HashMap::default();
         let allowlisted_items: HashSet<_> =
-            ctx.allowlisted_items().iter().cloned().collect();
+            ctx.allowlisted_items().iter().copied().collect();
 
         let allowlisted_and_blocklisted_items: ItemSet = allowlisted_items
             .iter()
-            .cloned()
+            .copied()
             .flat_map(|i| {
                 let mut reachable = vec![i];
                 i.trace(
@@ -480,7 +474,7 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
                         extra_assert!(dependencies.contains_key(&sub_item));
                     },
                     &(),
-                )
+                );
             }
         }
 
@@ -498,7 +492,7 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
         self.ctx
             .allowlisted_items()
             .iter()
-            .cloned()
+            .copied()
             .flat_map(|i| {
                 let mut reachable = vec![i];
                 i.trace(
@@ -524,8 +518,8 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
         // an analog to slice::split_at_mut.
         let mut used_by_this_id = self.take_this_id_usage_set(id);
 
-        trace!("constrain {:?}", id);
-        trace!("  initially, used set is {:?}", used_by_this_id);
+        trace!("constrain {id:?}");
+        trace!("  initially, used set is {used_by_this_id:?}");
 
         let original_len = used_by_this_id.len();
 
@@ -562,7 +556,7 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
             _ => self.constrain_join(&mut used_by_this_id, item),
         }
 
-        trace!("  finally, used set is {:?}", used_by_this_id);
+        trace!("  finally, used set is {used_by_this_id:?}");
 
         let new_len = used_by_this_id.len();
         assert!(
@@ -589,7 +583,7 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
     {
         if let Some(edges) = self.dependencies.get(&item) {
             for item in edges {
-                trace!("enqueue {:?} into worklist", item);
+                trace!("enqueue {item:?} into worklist");
                 f(*item);
             }
         }
diff --git a/bindgen/ir/annotations.rs b/bindgen/ir/annotations.rs
index 79f42df9..600bfa8b 100644
--- a/bindgen/ir/annotations.rs
+++ b/bindgen/ir/annotations.rs
@@ -227,7 +227,7 @@ impl Annotations {
                     "replaces" => {
                         self.use_instead_of = Some(
                             attr.value.split("::").map(Into::into).collect(),
-                        )
+                        );
                     }
                     "derive" => self.derives.push(attr.value),
                     "attribute" => self.attributes.push(attr.value),
@@ -239,7 +239,7 @@ impl Annotations {
                         };
                     }
                     "accessor" => {
-                        self.accessor_kind = Some(parse_accessor(&attr.value))
+                        self.accessor_kind = Some(parse_accessor(&attr.value));
                     }
                     "constant" => self.constify_enum_variant = true,
                     _ => {}
diff --git a/bindgen/ir/comp.rs b/bindgen/ir/comp.rs
index b2028883..68884bd2 100644
--- a/bindgen/ir/comp.rs
+++ b/bindgen/ir/comp.rs
@@ -803,9 +803,8 @@ impl CompFields {
 
                     anon_field_counter += 1;
                     *name = Some(format!(
-                        "{}{}",
+                        "{}{anon_field_counter}",
                         ctx.options().anon_fields_prefix,
-                        anon_field_counter
                     ));
                 }
                 Field::Bitfields(ref mut bu) => {
@@ -1278,7 +1277,7 @@ impl CompInfo {
 
         let kind = kind?;
 
-        debug!("CompInfo::from_ty({:?}, {:?})", kind, cursor);
+        debug!("CompInfo::from_ty({kind:?}, {cursor:?})");
 
         let mut ci = CompInfo::new(kind);
         ci.is_forward_declaration =
@@ -1614,7 +1613,7 @@ impl CompInfo {
                 _ => CompKind::Struct,
             },
             _ => {
-                warn!("Unknown kind for comp type: {:?}", cursor);
+                warn!("Unknown kind for comp type: {cursor:?}");
                 return Err(ParseError::Continue);
             }
         })
@@ -1699,7 +1698,7 @@ impl CompInfo {
         layout: Option<&Layout>,
     ) {
         let packed = self.is_packed(ctx, layout);
-        self.fields.compute_bitfield_units(ctx, packed)
+        self.fields.compute_bitfield_units(ctx, packed);
     }
 
     /// Assign for each anonymous field a generated name.
diff --git a/bindgen/ir/context.rs b/bindgen/ir/context.rs
index 1b488f99..d8bcaba1 100644
--- a/bindgen/ir/context.rs
+++ b/bindgen/ir/context.rs
@@ -698,10 +698,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
         declaration: Option<Cursor>,
         location: Option<Cursor>,
     ) {
-        debug!(
-            "BindgenContext::add_item({:?}, declaration: {:?}, loc: {:?}",
-            item, declaration, location
-        );
+        debug!("BindgenContext::add_item({item:?}, declaration: {declaration:?}, loc: {location:?}");
         debug_assert!(
             declaration.is_some() ||
                 !item.kind().is_type() ||
@@ -753,8 +750,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
                 // Fortunately, we don't care about those types being
                 // duplicated, so we can just ignore them.
                 debug!(
-                    "Invalid declaration {:?} found for type {:?}",
-                    declaration,
+                    "Invalid declaration {declaration:?} found for type {:?}",
                     self.resolve_item_fallible(id)
                         .unwrap()
                         .kind()
@@ -768,10 +764,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
             } else if let Some(usr) = declaration.usr() {
                 TypeKey::Usr(usr)
             } else {
-                warn!(
-                    "Valid declaration with no USR: {:?}, {:?}",
-                    declaration, location
-                );
+                warn!("Valid declaration with no USR: {declaration:?}, {location:?}");
                 TypeKey::Declaration(declaration)
             };
 
@@ -822,10 +815,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
         item: Item,
         definition: clang::Cursor,
     ) {
-        debug!(
-            "BindgenContext::add_type_param: item = {:?}; definition = {:?}",
-            item, definition
-        );
+        debug!("BindgenContext::add_type_param: item = {item:?}; definition = {definition:?}");
 
         assert!(
             item.expect_type().is_type_param(),
@@ -864,7 +854,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
             definition.kind(),
             clang_sys::CXCursor_TemplateTypeParameter
         );
-        self.type_params.get(definition).cloned()
+        self.type_params.get(definition).copied()
     }
 
     // TODO: Move all this syntax crap to other part of the code.
@@ -1111,7 +1101,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
         }
 
         for (id, replacement_id) in replacements {
-            debug!("Replacing {:?} with {:?}", id, replacement_id);
+            debug!("Replacing {id:?} with {replacement_id:?}");
             let new_parent = {
                 let item_id: ItemId = id.into();
                 let item = self.items[item_id.0].as_mut().unwrap();
@@ -1283,10 +1273,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
                         id.ancestors(self)
                             .chain(Some(self.root_module.into()))
                             .any(|ancestor| {
-                                debug!(
-                                    "Checking if {:?} is a child of {:?}",
-                                    id, ancestor
-                                );
+                                debug!("Checking if {id:?} is a child of {ancestor:?}");
                                 self.resolve_item(ancestor)
                                     .as_module()
                                     .is_some_and(|m| m.children().contains(&id))
@@ -1317,7 +1304,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
             .as_ref()
             .unwrap()
             .get(&id)
-            .cloned()
+            .copied()
             .unwrap_or(SizednessResult::ZeroSized)
     }
 
@@ -1341,7 +1328,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
             .as_ref()
             .unwrap()
             .get(&id.into())
-            .cloned()
+            .copied()
             .unwrap_or(HasVtableResult::No)
     }
 
@@ -1452,7 +1439,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
     // If at some point we care about the memory here, probably a map TypeKind
     // -> builtin type ItemId would be the best to improve that.
     fn add_builtin_item(&mut self, item: Item) {
-        debug!("add_builtin_item: item = {:?}", item);
+        debug!("add_builtin_item: item = {item:?}");
         debug_assert!(item.kind().is_type());
         self.add_item_to_module(&item);
         let id = item.id();
@@ -1541,7 +1528,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
         &self,
         definition: clang::Cursor,
     ) -> Option<ItemId> {
-        self.semantic_parents.get(&definition).cloned()
+        self.semantic_parents.get(&definition).copied()
     }
 
     /// Given a cursor pointing to the location of a template instantiation,
@@ -1589,7 +1576,6 @@ If you encounter an error missing from this list, please file an issue or a PR!"
                         self.currently_parsed_types()
                             .iter()
                             .find(|partial_ty| *partial_ty.decl() == referenced)
-                            .cloned()
                     })
                     .and_then(|template_decl| {
                         let num_template_params =
@@ -1789,8 +1775,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
                 }
                 _ => {
                     warn!(
-                        "Found template arg cursor we can't handle: {:?}",
-                        child
+                        "Found template arg cursor we can't handle: {child:?}"
                     );
                     found_const_arg = true;
                 }
@@ -1841,7 +1826,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
         );
 
         // Bypass all the validations in add_item explicitly.
-        debug!("instantiate_template: inserting item: {:?}", item);
+        debug!("instantiate_template: inserting item: {item:?}");
         self.add_item_to_module(&item);
         debug_assert_eq!(with_id, item.id());
         self.items[with_id.0] = Some(item);
@@ -1861,7 +1846,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
                     .usr()
                     .and_then(|usr| self.types.get(&TypeKey::Usr(usr)))
             })
-            .cloned()
+            .copied()
     }
 
     /// Looks up for an already resolved type, either because it's builtin, or
@@ -1874,16 +1859,12 @@ If you encounter an error missing from this list, please file an issue or a PR!"
         location: Option<clang::Cursor>,
     ) -> Option<TypeId> {
         use clang_sys::{CXCursor_TypeAliasTemplateDecl, CXCursor_TypeRef};
-        debug!(
-            "builtin_or_resolved_ty: {:?}, {:?}, {:?}, {:?}",
-            ty, location, with_id, parent_id
-        );
+        debug!("builtin_or_resolved_ty: {ty:?}, {location:?}, {with_id:?}, {parent_id:?}");
 
         if let Some(decl) = ty.canonical_declaration(location.as_ref()) {
             if let Some(id) = self.get_resolved_type(&decl) {
                 debug!(
-                    "Already resolved ty {:?}, {:?}, {:?} {:?}",
-                    id, decl, ty, location
+                    "Already resolved ty {id:?}, {decl:?}, {ty:?} {location:?}"
                 );
                 // If the declaration already exists, then either:
                 //
@@ -2204,19 +2185,14 @@ If you encounter an error missing from this list, please file an issue or a PR!"
     pub(crate) fn replace(&mut self, name: &[String], potential_ty: ItemId) {
         match self.replacements.entry(name.into()) {
             Entry::Vacant(entry) => {
-                debug!(
-                    "Defining replacement for {:?} as {:?}",
-                    name, potential_ty
-                );
+                debug!("Defining replacement for {name:?} as {potential_ty:?}");
                 entry.insert(potential_ty);
             }
             Entry::Occupied(occupied) => {
                 warn!(
-                    "Replacement for {:?} already defined as {:?}; \
-                     ignoring duplicate replacement definition as {:?}",
-                    name,
+                    "Replacement for {name:?} already defined as {:?}; \
+                     ignoring duplicate replacement definition as {potential_ty:?}",
                     occupied.get(),
-                    potential_ty
                 );
             }
         }
@@ -2262,7 +2238,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
         let mut module_name = None;
         let spelling = cursor.spelling();
         if !spelling.is_empty() {
-            module_name = Some(spelling)
+            module_name = Some(spelling);
         }
 
         let mut kind = ModuleKind::Normal;
@@ -2313,10 +2289,8 @@ If you encounter an error missing from this list, please file an issue or a PR!"
                         //
                         // See also https://github.com/rust-lang/rust-bindgen/issues/1676.
                         warn!(
-                            "Ignored unknown namespace prefix '{}' at {:?} in {:?}",
+                            "Ignored unknown namespace prefix '{}' at {token:?} in {cursor:?}",
                             String::from_utf8_lossy(name),
-                            token,
-                            cursor
                         );
                     }
                 }
@@ -2496,7 +2470,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
                     }
 
                     let name = item.path_for_allowlisting(self)[1..].join("::");
-                    debug!("allowlisted_items: testing {:?}", name);
+                    debug!("allowlisted_items: testing {name:?}");
 
                     if self.options().allowlisted_items.matches(&name) {
                         return true;
@@ -2647,7 +2621,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
 
     /// Call if a bindgen complex is generated
     pub(crate) fn generated_bindgen_complex(&self) {
-        self.generated_bindgen_complex.set(true)
+        self.generated_bindgen_complex.set(true);
     }
 
     /// Whether we need to generate the bindgen complex type
@@ -2657,7 +2631,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
 
     /// Call if a bindgen float16 is generated
     pub(crate) fn generated_bindgen_float16(&self) {
-        self.generated_bindgen_float16.set(true)
+        self.generated_bindgen_float16.set(true);
     }
 
     /// Whether we need to generate the bindgen float16 type
@@ -2865,7 +2839,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
             .as_ref()
             .unwrap()
             .get(&id)
-            .cloned()
+            .copied()
             .unwrap_or(CanDerive::Yes)
     }
 
@@ -3134,7 +3108,7 @@ impl TemplateParameters for PartialType {
 }
 
 fn unused_regex_diagnostic(item: &str, name: &str, _ctx: &BindgenContext) {
-    warn!("unused option: {} {}", name, item);
+    warn!("unused option: {name} {item}");
 
     #[cfg(feature = "experimental")]
     if _ctx.options().emit_diagnostics {
diff --git a/bindgen/ir/derive.rs b/bindgen/ir/derive.rs
index 5475ffdb..3ee6476a 100644
--- a/bindgen/ir/derive.rs
+++ b/bindgen/ir/derive.rs
@@ -125,6 +125,6 @@ impl ops::BitOr for CanDerive {
 
 impl ops::BitOrAssign for CanDerive {
     fn bitor_assign(&mut self, rhs: Self) {
-        *self = self.join(rhs)
+        *self = self.join(rhs);
     }
 }
diff --git a/bindgen/ir/dot.rs b/bindgen/ir/dot.rs
index d5c1a42f..9b81b874 100644
--- a/bindgen/ir/dot.rs
+++ b/bindgen/ir/dot.rs
@@ -52,10 +52,9 @@ where
 
                 match writeln!(
                     &mut dot_file,
-                    "{} -> {} [label={:?}, color={}];",
+                    "{} -> {} [label={edge_kind:?}, color={}];",
                     id.as_usize(),
                     sub_id.as_usize(),
-                    edge_kind,
                     if is_allowlisted { "black" } else { "gray" }
                 ) {
                     Ok(_) => {}
diff --git a/bindgen/ir/enum_ty.rs b/bindgen/ir/enum_ty.rs
index 1efa1a63..9b08da3b 100644
--- a/bindgen/ir/enum_ty.rs
+++ b/bindgen/ir/enum_ty.rs
@@ -59,7 +59,7 @@ impl Enum {
         ctx: &mut BindgenContext,
     ) -> Result<Self, ParseError> {
         use clang_sys::*;
-        debug!("Enum::from_ty {:?}", ty);
+        debug!("Enum::from_ty {ty:?}");
 
         if ty.kind() != CXType_Enum {
             return Err(ParseError::Continue);
diff --git a/bindgen/ir/function.rs b/bindgen/ir/function.rs
index f90fe0ef..6fcb8d1f 100644
--- a/bindgen/ir/function.rs
+++ b/bindgen/ir/function.rs
@@ -418,7 +418,7 @@ impl FunctionSig {
         ctx: &mut BindgenContext,
     ) -> Result<Self, ParseError> {
         use clang_sys::*;
-        debug!("FunctionSig::from_ty {:?} {:?}", ty, cursor);
+        debug!("FunctionSig::from_ty {ty:?} {cursor:?}");
 
         // Skip function templates
         let kind = cursor.kind();
@@ -596,7 +596,7 @@ impl FunctionSig {
         let abi = get_abi(call_conv);
 
         if abi.is_unknown() {
-            warn!("Unknown calling convention: {:?}", call_conv);
+            warn!("Unknown calling convention: {call_conv:?}");
         }
 
         Ok(Self {
@@ -726,7 +726,7 @@ impl ClangSubItemParser for Function {
             Some(k) => k,
         };
 
-        debug!("Function::parse({:?}, {:?})", cursor, cursor.cur_type());
+        debug!("Function::parse({cursor:?}, {:?})", cursor.cur_type());
         let visibility = cursor.visibility();
         if visibility != CXVisibility_Default {
             return Err(ParseError::Continue);
diff --git a/bindgen/ir/item.rs b/bindgen/ir/item.rs
index a7289838..ee0fdc52 100644
--- a/bindgen/ir/item.rs
+++ b/bindgen/ir/item.rs
@@ -1420,11 +1420,7 @@ impl Item {
             CXCursor_UsingDirective |
             CXCursor_StaticAssert |
             CXCursor_FunctionTemplate => {
-                debug!(
-                    "Unhandled cursor kind {:?}: {:?}",
-                    cursor.kind(),
-                    cursor
-                );
+                debug!("Unhandled cursor kind {:?}: {cursor:?}", cursor.kind(),);
                 Err(ParseError::Continue)
             }
 
@@ -1432,7 +1428,7 @@ impl Item {
                 let file = cursor.get_included_file_name();
                 match file {
                     None => {
-                        warn!("Inclusion of a nameless file in {:?}", cursor);
+                        warn!("Inclusion of a nameless file in {cursor:?}");
                     }
                     Some(included_file) => {
                         for cb in &ctx.options().parse_callbacks {
@@ -1450,9 +1446,8 @@ impl Item {
                 let spelling = cursor.spelling();
                 if !spelling.starts_with("operator") {
                     warn!(
-                        "Unhandled cursor kind {:?}: {:?}",
+                        "Unhandled cursor kind {:?}: {cursor:?}",
                         cursor.kind(),
-                        cursor
                     );
                 }
                 Err(ParseError::Continue)
@@ -1489,10 +1484,7 @@ impl Item {
         parent_id: Option<ItemId>,
         ctx: &mut BindgenContext,
     ) -> TypeId {
-        debug!(
-            "from_ty_or_ref_with_id: {:?} {:?}, {:?}, {:?}",
-            potential_id, ty, location, parent_id
-        );
+        debug!("from_ty_or_ref_with_id: {potential_id:?} {ty:?}, {location:?}, {parent_id:?}");
 
         if ctx.collected_typerefs() {
             debug!("refs already collected, resolving directly");
@@ -1512,11 +1504,11 @@ impl Item {
             &ty,
             Some(location),
         ) {
-            debug!("{:?} already resolved: {:?}", ty, location);
+            debug!("{ty:?} already resolved: {location:?}");
             return ty;
         }
 
-        debug!("New unresolved type reference: {:?}, {:?}", ty, location);
+        debug!("New unresolved type reference: {ty:?}, {location:?}");
 
         let is_const = ty.is_const();
         let kind = TypeKind::UnresolvedTypeRef(ty, location, parent_id);
@@ -1566,10 +1558,9 @@ impl Item {
         use clang_sys::*;
 
         debug!(
-            "Item::from_ty_with_id: {:?}\n\
-             \tty = {:?},\n\
-             \tlocation = {:?}",
-            id, ty, location
+            "Item::from_ty_with_id: {id:?}\n\
+             \tty = {ty:?},\n\
+             \tlocation = {location:?}",
         );
 
         if ty.kind() == clang_sys::CXType_Unexposed ||
@@ -1593,7 +1584,7 @@ impl Item {
         // ignore function bodies. See issue #2036.)
         if let Some(ref parent) = ty.declaration().fallible_semantic_parent() {
             if FunctionKind::from_cursor(parent).is_some() {
-                debug!("Skipping type declared inside function: {:?}", ty);
+                debug!("Skipping type declared inside function: {ty:?}");
                 return Ok(Item::new_opaque_type(id, ty, ctx));
             }
         }
@@ -1640,7 +1631,7 @@ impl Item {
                 .iter()
                 .find(|ty| *ty.decl() == declaration_to_look_for)
             {
-                debug!("Avoiding recursion parsing type: {:?}", ty);
+                debug!("Avoiding recursion parsing type: {ty:?}");
                 // Unchecked because we haven't finished this type yet.
                 return Ok(partial.id().as_type_id_unchecked());
             }
diff --git a/bindgen/ir/module.rs b/bindgen/ir/module.rs
index 5ec55e90..4788cf42 100644
--- a/bindgen/ir/module.rs
+++ b/bindgen/ir/module.rs
@@ -84,8 +84,8 @@ impl ClangSubItemParser for Module {
                 let module_id = ctx.module(cursor);
                 ctx.with_module(module_id, |ctx| {
                     cursor.visit_sorted(ctx, |ctx, child| {
-                        parse_one(ctx, child, Some(module_id.into()))
-                    })
+                        parse_one(ctx, child, Some(module_id.into()));
+                    });
                 });
 
                 Ok(ParseResult::AlreadyResolved(module_id.into()))
diff --git a/bindgen/ir/objc.rs b/bindgen/ir/objc.rs
index a748d9a1..6d830959 100644
--- a/bindgen/ir/objc.rs
+++ b/bindgen/ir/objc.rs
@@ -87,7 +87,7 @@ impl ObjCInterface {
     /// and protocols are like PNSObject
     pub(crate) fn rust_name(&self) -> String {
         if let Some(ref cat) = self.category {
-            format!("{}_{}", self.name(), cat)
+            format!("{}_{cat}", self.name())
         } else if self.is_protocol {
             format!("P{}", self.name())
         } else {
@@ -147,8 +147,8 @@ impl ObjCInterface {
                     let needle = format!("P{}", c.spelling());
                     let items_map = ctx.items();
                     debug!(
-                        "Interface {} conforms to {}, find the item",
-                        interface.name, needle
+                        "Interface {} conforms to {needle}, find the item",
+                        interface.name,
                     );
 
                     for (id, item) in items_map {
@@ -163,10 +163,7 @@ impl ObjCInterface {
                                         ty.name()
                                     );
                                     if Some(needle.as_ref()) == ty.name() {
-                                        debug!(
-                                            "Found conforming protocol {:?}",
-                                            item
-                                        );
+                                        debug!("Found conforming protocol {item:?}");
                                         interface.conforms_to.push(id);
                                         break;
                                     }
@@ -308,7 +305,7 @@ impl ObjCMethod {
             let arg = arg.to_string();
             let name_and_sig: Vec<&str> = arg.split(' ').collect();
             let name = name_and_sig[0];
-            args_without_types.push(Ident::new(name, Span::call_site()))
+            args_without_types.push(Ident::new(name, Span::call_site()));
         }
 
         let args = split_name.into_iter().zip(args_without_types).map(
diff --git a/bindgen/ir/traversal.rs b/bindgen/ir/traversal.rs
index 9a0a02b8..ccf3af9a 100644
--- a/bindgen/ir/traversal.rs
+++ b/bindgen/ir/traversal.rs
@@ -344,7 +344,7 @@ where
     F: FnMut(ItemId, EdgeKind),
 {
     fn visit_kind(&mut self, item: ItemId, kind: EdgeKind) {
-        (*self)(item, kind)
+        (*self)(item, kind);
     }
 }
 
@@ -437,7 +437,7 @@ where
         let is_newly_discovered =
             self.seen.add(self.currently_traversing, item);
         if is_newly_discovered {
-            self.queue.push(item)
+            self.queue.push(item);
         }
     }
 }
diff --git a/bindgen/ir/ty.rs b/bindgen/ir/ty.rs
index e55175eb..fc3bfa60 100644
--- a/bindgen/ir/ty.rs
+++ b/bindgen/ir/ty.rs
@@ -471,7 +471,7 @@ impl TypeKind {
 #[test]
 fn is_invalid_type_param_valid() {
     let ty = Type::new(Some("foo".into()), None, TypeKind::TypeParam, false);
-    assert!(!ty.is_invalid_type_param())
+    assert!(!ty.is_invalid_type_param());
 }
 
 #[test]
@@ -482,38 +482,38 @@ fn is_invalid_type_param_valid_underscore_and_numbers() {
         TypeKind::TypeParam,
         false,
     );
-    assert!(!ty.is_invalid_type_param())
+    assert!(!ty.is_invalid_type_param());
 }
 
 #[test]
 fn is_invalid_type_param_valid_unnamed_kind() {
     let ty = Type::new(Some("foo".into()), None, TypeKind::Void, false);
-    assert!(!ty.is_invalid_type_param())
+    assert!(!ty.is_invalid_type_param());
 }
 
 #[test]
 fn is_invalid_type_param_invalid_start() {
     let ty = Type::new(Some("1foo".into()), None, TypeKind::TypeParam, false);
-    assert!(ty.is_invalid_type_param())
+    assert!(ty.is_invalid_type_param());
 }
 
 #[test]
 fn is_invalid_type_param_invalid_remaining() {
     let ty = Type::new(Some("foo-".into()), None, TypeKind::TypeParam, false);
-    assert!(ty.is_invalid_type_param())
+    assert!(ty.is_invalid_type_param());
 }
 
 #[test]
 #[should_panic]
 fn is_invalid_type_param_unnamed() {
     let ty = Type::new(None, None, TypeKind::TypeParam, false);
-    assert!(ty.is_invalid_type_param())
+    assert!(ty.is_invalid_type_param());
 }
 
 #[test]
 fn is_invalid_type_param_empty_name() {
     let ty = Type::new(Some("".into()), None, TypeKind::TypeParam, false);
-    assert!(ty.is_invalid_type_param())
+    assert!(ty.is_invalid_type_param());
 }
 
 impl TemplateParameters for Type {
@@ -685,7 +685,7 @@ impl Type {
                 Some(location),
             );
             if let Some(ty) = already_resolved {
-                debug!("{:?} already resolved: {:?}", ty, location);
+                debug!("{ty:?} already resolved: {location:?}");
                 return Ok(ParseResult::AlreadyResolved(ty.into()));
             }
         }
@@ -700,8 +700,7 @@ impl Type {
         };
 
         debug!(
-            "from_clang_ty: {:?}, ty: {:?}, loc: {:?}",
-            potential_id, ty, location
+            "from_clang_ty: {potential_id:?}, ty: {ty:?}, loc: {location:?}"
         );
         debug!("currently_parsed_types: {:?}", ctx.currently_parsed_types());
 
@@ -711,7 +710,7 @@ impl Type {
         let mut ty_kind = ty.kind();
         match location.kind() {
             CXCursor_ObjCProtocolDecl | CXCursor_ObjCCategoryDecl => {
-                ty_kind = CXType_ObjCInterface
+                ty_kind = CXType_ObjCInterface;
             }
             _ => {}
         }
@@ -776,7 +775,7 @@ impl Type {
                                     // etc.
                                     !canonical_ty.spelling().contains("type-parameter") =>
                 {
-                    debug!("Looking for canonical type: {:?}", canonical_ty);
+                    debug!("Looking for canonical type: {canonical_ty:?}");
                     return Self::from_clang_ty(
                         potential_id,
                         &canonical_ty,
@@ -797,10 +796,7 @@ impl Type {
                     // Same here, with template specialisations we can safely
                     // assume this is a Comp(..)
                     } else if ty.is_fully_instantiated_template() {
-                        debug!(
-                            "Template specialization: {:?}, {:?} {:?}",
-                            ty, location, canonical_ty
-                        );
+                        debug!("Template specialization: {ty:?}, {location:?} {canonical_ty:?}");
                         let complex = CompInfo::from_ty(
                             potential_id,
                             ty,
@@ -948,13 +944,7 @@ impl Type {
                                 let referenced = location.referenced().unwrap();
                                 let referenced_ty = referenced.cur_type();
 
-                                debug!(
-                                    "TemplateRef: location = {:?}; referenced = \
-                                        {:?}; referenced_ty = {:?}",
-                                    location,
-                                    referenced,
-                                    referenced_ty
-                                );
+                                debug!("TemplateRef: location = {location:?}; referenced = {referenced:?}; referenced_ty = {referenced_ty:?}");
 
                                 return Self::from_clang_ty(
                                     potential_id,
@@ -969,11 +959,7 @@ impl Type {
                                 let referenced_ty = referenced.cur_type();
                                 let declaration = referenced_ty.declaration();
 
-                                debug!(
-                                    "TypeRef: location = {:?}; referenced = \
-                                     {:?}; referenced_ty = {:?}",
-                                    location, referenced, referenced_ty
-                                );
+                                debug!("TypeRef: location = {location:?}; referenced = {referenced:?}; referenced_ty = {referenced_ty:?}");
 
                                 let id = Item::from_ty_or_ref_with_id(
                                     potential_id,
@@ -991,16 +977,11 @@ impl Type {
                             }
                             _ => {
                                 if ty.kind() == CXType_Unexposed {
-                                    warn!(
-                                        "Unexposed type {:?}, recursing inside, \
-                                          loc: {:?}",
-                                        ty,
-                                        location
-                                    );
+                                    warn!("Unexposed type {ty:?}, recursing inside, loc: {location:?}");
                                     return Err(ParseError::Recurse);
                                 }
 
-                                warn!("invalid type {:?}", ty);
+                                warn!("invalid type {ty:?}");
                                 return Err(ParseError::Continue);
                             }
                         }
@@ -1008,7 +989,7 @@ impl Type {
                 }
                 CXType_Auto => {
                     if canonical_ty == *ty {
-                        debug!("Couldn't find deduced type: {:?}", ty);
+                        debug!("Couldn't find deduced type: {ty:?}");
                         return Err(ParseError::Continue);
                     }
 
@@ -1203,10 +1184,8 @@ impl Type {
                 }
                 _ => {
                     warn!(
-                        "unsupported type: kind = {:?}; ty = {:?}; at {:?}",
+                        "unsupported type: kind = {:?}; ty = {ty:?}; at {location:?}",
                         ty.kind(),
-                        ty,
-                        location
                     );
                     return Err(ParseError::Continue);
                 }
diff --git a/bindgen/ir/var.rs b/bindgen/ir/var.rs
index 2ff14897..2aa92f84 100644
--- a/bindgen/ir/var.rs
+++ b/bindgen/ir/var.rs
@@ -399,7 +399,7 @@ fn parse_macro_clang_fallback(
     }
 
     let ftu = ctx.try_ensure_fallback_translation_unit()?;
-    let contents = format!("int main() {{ {}; }}", cursor.spelling(),);
+    let contents = format!("int main() {{ {}; }}", cursor.spelling());
     ftu.reparse(&contents).ok()?;
     // Children of root node of AST
     let root_children = ftu.translation_unit().cursor().collect_children();
@@ -480,7 +480,7 @@ fn duplicated_macro_diagnostic(
     _location: crate::clang::SourceLocation,
     _ctx: &BindgenContext,
 ) {
-    warn!("Duplicated macro definition: {}", macro_name);
+    warn!("Duplicated macro definition: {macro_name}");
 
     #[cfg(feature = "experimental")]
     // FIXME (pvdrz & amanjeev): This diagnostic message shows way too often to be actually
diff --git a/bindgen/lib.rs b/bindgen/lib.rs
index 3c09069e..e599f759 100644
--- a/bindgen/lib.rs
+++ b/bindgen/lib.rs
@@ -50,14 +50,14 @@ mod regex_set;
 pub use codegen::{
     AliasVariation, EnumVariation, MacroTypeVariation, NonCopyUnionStyle,
 };
-pub use features::{RustTarget, LATEST_STABLE_RUST};
+pub use features::{RustEdition, RustTarget, LATEST_STABLE_RUST};
 pub use ir::annotations::FieldVisibilityKind;
 pub use ir::function::Abi;
 #[cfg(feature = "__cli")]
 pub use options::cli::builder_from_flags;
 
 use codegen::CodegenError;
-use features::{RustEdition, RustFeatures};
+use features::RustFeatures;
 use ir::comment;
 use ir::context::{BindgenContext, ItemId};
 use ir::item::Item;
@@ -810,8 +810,7 @@ impl Bindings {
             };
 
             debug!(
-                "Trying to find clang with flags: {:?}",
-                clang_args_for_clang_sys
+                "Trying to find clang with flags: {clang_args_for_clang_sys:?}"
             );
 
             let clang = match clang_sys::support::Clang::find(
@@ -822,7 +821,7 @@ impl Bindings {
                 Some(clang) => clang,
             };
 
-            debug!("Found clang: {:?}", clang);
+            debug!("Found clang: {clang:?}");
 
             // Whether we are working with C or C++ inputs.
             let is_cpp = args_are_cpp(&options.clang_args) ||
@@ -878,10 +877,10 @@ impl Bindings {
             if idx != 0 || !options.input_headers.is_empty() {
                 options.clang_args.push("-include".into());
             }
-            options.clang_args.push(f.name.to_str().unwrap().into())
+            options.clang_args.push(f.name.to_str().unwrap().into());
         }
 
-        debug!("Fixed-up options: {:?}", options);
+        debug!("Fixed-up options: {options:?}");
 
         let time_phases = options.time_phases;
         let mut context = BindgenContext::new(options, &input_unsaved_files);
@@ -1045,7 +1044,7 @@ impl Bindings {
 }
 
 fn rustfmt_non_fatal_error_diagnostic(msg: &str, _options: &BindgenOptions) {
-    warn!("{}", msg);
+    warn!("{msg}");
 
     #[cfg(feature = "experimental")]
     if _options.emit_diagnostics {
@@ -1135,7 +1134,7 @@ fn parse(context: &mut BindgenContext) -> Result<(), BindgenError> {
 
     let root = context.root_module();
     context.with_module(root, |ctx| {
-        cursor.visit_sorted(ctx, |ctx, child| parse_one(ctx, child, None))
+        cursor.visit_sorted(ctx, |ctx, child| parse_one(ctx, child, None));
     });
 
     assert!(
@@ -1203,7 +1202,7 @@ fn get_target_dependent_env_var(
         }
         if let Ok(v) = env_var(
             parse_callbacks,
-            format!("{}_{}", var, target.replace('-', "_")),
+            format!("{var}_{}", target.replace('-', "_")),
         ) {
             return Some(v);
         }
diff --git a/bindgen/options/cli.rs b/bindgen/options/cli.rs
index e444432d..834c7c76 100644
--- a/bindgen/options/cli.rs
+++ b/bindgen/options/cli.rs
@@ -1069,7 +1069,7 @@ impl CliArg for bool {
         f: impl Fn(Builder, Self::Value) -> Builder,
     ) -> Builder {
         if self {
-            builder = f(builder, self)
+            builder = f(builder, self);
         }
 
         builder
diff --git a/bindgen/regex_set.rs b/bindgen/regex_set.rs
index d842af48..be0041dc 100644
--- a/bindgen/regex_set.rs
+++ b/bindgen/regex_set.rs
@@ -56,7 +56,7 @@ impl RegexSet {
     #[inline]
     #[allow(unused)]
     pub(crate) fn build(&mut self, record_matches: bool) {
-        self.build_inner(record_matches, None)
+        self.build_inner(record_matches, None);
     }
 
     #[cfg(all(feature = "__cli", feature = "experimental"))]
@@ -71,7 +71,7 @@ impl RegexSet {
         record_matches: bool,
         name: Option<&'static str>,
     ) {
-        self.build_inner(record_matches, name)
+        self.build_inner(record_matches, name);
     }
 
     #[cfg(all(not(feature = "__cli"), feature = "experimental"))]
@@ -86,7 +86,7 @@ impl RegexSet {
         record_matches: bool,
         name: Option<&'static str>,
     ) {
-        self.build_inner(record_matches, name)
+        self.build_inner(record_matches, name);
     }
 
     fn build_inner(
@@ -99,7 +99,7 @@ impl RegexSet {
         self.set = match RxSet::new(items) {
             Ok(x) => Some(x),
             Err(e) => {
-                warn!("Invalid regex in {:?}: {:?}", self.items, e);
+                warn!("Invalid regex in {:?}: {e:?}", self.items);
                 #[cfg(feature = "experimental")]
                 if let Some(name) = _name {
                     invalid_regex_warning(self, e, name);
diff --git a/bindgen/time.rs b/bindgen/time.rs
index 402327fd..435890c4 100644
--- a/bindgen/time.rs
+++ b/bindgen/time.rs
@@ -39,7 +39,7 @@ impl<'a> Timer<'a> {
                 (elapsed.subsec_nanos() as f64) / 1e6;
             let stderr = io::stderr();
             // Arbitrary output format, subject to change.
-            writeln!(stderr.lock(), "  time: {:>9.3} ms.\t{}", time, self.name)
+            writeln!(stderr.lock(), "  time: {time:>9.3} ms.\t{}", self.name)
                 .expect("timer write should not fail");
         }
     }
diff --git a/book/src/code-formatting.md b/book/src/code-formatting.md
index 9c82e83a..368535c4 100644
--- a/book/src/code-formatting.md
+++ b/book/src/code-formatting.md
@@ -47,8 +47,7 @@ fn main() {
 
     assert!(
         output.status.success(),
-        "Unsuccessful status code when running `rustup`: {:?}",
-        output
+        "Unsuccessful status code when running `rustup`: {output:?}",
     );
 
     let rustfmt_path =
diff --git a/book/src/tutorial-5.md b/book/src/tutorial-5.md
index de91d092..8a71dac3 100644
--- a/book/src/tutorial-5.md
+++ b/book/src/tutorial-5.md
@@ -40,7 +40,7 @@ mod tests {
                 r if r == (BZ_PARAM_ERROR as _) => panic!("BZ_PARAM_ERROR"),
                 r if r == (BZ_MEM_ERROR as _) => panic!("BZ_MEM_ERROR"),
                 r if r == (BZ_OK as _) => {},
-                r => panic!("Unknown return value = {}", r),
+                r => panic!("Unknown return value = {r}"),
             }
 
             // Compress `input` into `compressed_output`.
@@ -55,7 +55,7 @@ mod tests {
                 r if r == (BZ_FINISH_OK as _) => panic!("BZ_FINISH_OK"),
                 r if r == (BZ_SEQUENCE_ERROR as _) => panic!("BZ_SEQUENCE_ERROR"),
                 r if r == (BZ_STREAM_END as _) => {},
-                r => panic!("Unknown return value = {}", r),
+                r => panic!("Unknown return value = {r}"),
             }
 
             // Finish the compression stream.
@@ -63,7 +63,7 @@ mod tests {
             match result {
                 r if r == (BZ_PARAM_ERROR as _) => panic!("BZ_PARAM_ERROR"),
                 r if r == (BZ_OK as _) => {},
-                r => panic!("Unknown return value = {}", r),
+                r => panic!("Unknown return value = {r}"),
             }
 
             // Construct a decompression stream.
@@ -76,7 +76,7 @@ mod tests {
                 r if r == (BZ_PARAM_ERROR as _) => panic!("BZ_PARAM_ERROR"),
                 r if r == (BZ_MEM_ERROR as _) => panic!("BZ_MEM_ERROR"),
                 r if r == (BZ_OK as _) => {},
-                r => panic!("Unknown return value = {}", r),
+                r => panic!("Unknown return value = {r}"),
             }
 
             // Decompress `compressed_output` into `decompressed_output`.
@@ -92,7 +92,7 @@ mod tests {
                 r if r == (BZ_MEM_ERROR as _) => panic!("BZ_MEM_ERROR"),
                 r if r == (BZ_OK as _) => panic!("BZ_OK"),
                 r if r == (BZ_STREAM_END as _) => {},
-                r => panic!("Unknown return value = {}", r),
+                r => panic!("Unknown return value = {r}"),
             }
 
             // Close the decompression stream.
@@ -100,7 +100,7 @@ mod tests {
             match result {
                 r if r == (BZ_PARAM_ERROR as _) => panic!("BZ_PARAM_ERROR"),
                 r if r == (BZ_OK as _) => {},
-                r => panic!("Unknown return value = {}", r),
+                r => panic!("Unknown return value = {r}"),
             }
 
             assert_eq!(input, &decompressed_output[..]);


Test patch:
diff --git a/bindgen-tests/Cargo.toml b/bindgen-tests/Cargo.toml
index b9547bb1..346be51c 100644
--- a/bindgen-tests/Cargo.toml
+++ b/bindgen-tests/Cargo.toml
@@ -1,19 +1,19 @@
 [package]
 name = "bindgen-tests"
-edition = "2021"
 version = "0.1.0"
 publish = false
+rust-version.workspace = true
+edition.workspace = true
 
 [dev-dependencies]
-bindgen = { path = "../bindgen", features = ["__cli", "experimental"] }
-owo-colors = "3.5.0"
-prettyplease = { version = "0.2.7", features = ["verbatim"] }
-similar = { version = "2.2.1", features = ["inline"] }
-tempfile = "3"
-
+bindgen = { workspace = true, default-features = true, features = ["__cli", "experimental"] }
+owo-colors.workspace = true
+prettyplease = { workspace = true, features = ["verbatim"] }
 proc-macro2.workspace = true
 shlex.workspace = true
+similar = { workspace = true, features = ["inline"] }
 syn.workspace = true
+tempfile.workspace = true
 
 [features]
 logging = ["bindgen/logging"]
diff --git a/bindgen-tests/build.rs b/bindgen-tests/build.rs
index 6b2f2c72..713dbb3c 100644
--- a/bindgen-tests/build.rs
+++ b/bindgen-tests/build.rs
@@ -35,8 +35,7 @@ pub fn main() {
                     .to_lowercase();
                 writeln!(
                     dst,
-                    "test_header!(header_{}, {:?});",
-                    func,
+                    "test_header!(header_{func}, {:?});",
                     entry.path(),
                 )
                 .unwrap();
diff --git a/bindgen-tests/tests/expectations/Cargo.toml b/bindgen-tests/tests/expectations/Cargo.toml
index e7206360..2f77baf7 100644
--- a/bindgen-tests/tests/expectations/Cargo.toml
+++ b/bindgen-tests/tests/expectations/Cargo.toml
@@ -7,13 +7,14 @@ authors = [
   "Emilio Cobos Álvarez <emilio@crisal.io>",
   "The Servo project developers",
 ]
-edition = "2021"
 publish = false
+rust-version.workspace = true
+edition.workspace = true
 
 [dependencies]
-block = "0.1"
-libloading = "0.7"
-objc = "0.2"
+block.workspace = true
+libloading.workspace = true
+objc.workspace = true
 
 [lints.rust]
 ### FIXME: these might need to be fixed,
@@ -21,7 +22,10 @@ objc = "0.2"
 # deprecated = "allow"
 # invalid-value = "allow"
 # unsupported_calling_conventions = "allow"
+dead_code = "allow"
 non-snake-case = "allow"
+non_camel_case_types = "allow"
+non_upper_case_globals = "allow"
 unexpected-cfgs = "allow"
 
 [lints.clippy]
@@ -30,6 +34,7 @@ manual-c-str-literals = "allow"
 missing-safety-doc = "allow"
 op-ref = "allow"
 ptr-offset-with-cast = "allow"
+semicolon_if_nothing_returned = "allow"
 too-many-arguments = "allow"
 transmute-int-to-bool = "allow"
 unnecessary-cast = "allow"
diff --git a/bindgen-tests/tests/expectations/lib.rs b/bindgen-tests/tests/expectations/lib.rs
index 562dc554..e69de29b 100755
--- a/bindgen-tests/tests/expectations/lib.rs
+++ b/bindgen-tests/tests/expectations/lib.rs
@@ -1,3 +0,0 @@
-#![allow(dead_code)]
-#![allow(non_camel_case_types)]
-#![allow(non_upper_case_globals)]
diff --git a/bindgen-tests/tests/parse_callbacks/mod.rs b/bindgen-tests/tests/parse_callbacks/mod.rs
index c372ce10..2fba5f11 100644
--- a/bindgen-tests/tests/parse_callbacks/mod.rs
+++ b/bindgen-tests/tests/parse_callbacks/mod.rs
@@ -52,7 +52,7 @@ impl ParseCallbacks for PrefixLinkNameParseCallback {
     ) -> Option<String> {
         self.prefix
             .as_deref()
-            .map(|prefix| format!("{}{}", prefix, item_info.name))
+            .map(|prefix| format!("{prefix}{}", item_info.name))
     }
 }
 
diff --git a/bindgen-tests/tests/quickchecking/Cargo.toml b/bindgen-tests/tests/quickchecking/Cargo.toml
index 998643bb..ca36eb1c 100644
--- a/bindgen-tests/tests/quickchecking/Cargo.toml
+++ b/bindgen-tests/tests/quickchecking/Cargo.toml
@@ -3,8 +3,8 @@ name = "quickchecking"
 description = "Bindgen property tests with quickcheck. Generate random valid C code and pass it to the csmith/predicate.py script"
 version = "0.0.0"
 publish = false
-rust-version = "1.70"
-edition = "2021"
+rust-version.workspace = true
+edition.workspace = true
 
 [lib]
 name = "quickchecking"
@@ -15,9 +15,9 @@ name = "quickchecking"
 path = "src/bin.rs"
 
 [dependencies]
-clap = "4"
-quickcheck = "1.0"
-tempfile = "3"
+clap.workspace = true
+quickcheck.workspace = true
+tempfile.workspace = true
 
 [features]
 # No features by default.
diff --git a/bindgen-tests/tests/quickchecking/src/bin.rs b/bindgen-tests/tests/quickchecking/src/bin.rs
index fcd56652..66da94fe 100644
--- a/bindgen-tests/tests/quickchecking/src/bin.rs
+++ b/bindgen-tests/tests/quickchecking/src/bin.rs
@@ -105,5 +105,5 @@ fn main() {
     let generate_range = *matches.get_one::<usize>("range").unwrap();
     let tests = *matches.get_one::<u64>("count").unwrap();
 
-    quickchecking::test_bindgen(generate_range, tests, output_path)
+    quickchecking::test_bindgen(generate_range, tests, output_path);
 }
diff --git a/bindgen-tests/tests/quickchecking/src/lib.rs b/bindgen-tests/tests/quickchecking/src/lib.rs
index 2c33858a..2f0b575c 100644
--- a/bindgen-tests/tests/quickchecking/src/lib.rs
+++ b/bindgen-tests/tests/quickchecking/src/lib.rs
@@ -9,7 +9,7 @@
 //! let generate_range: usize = 10; // Determines things like the length of
 //!                                 // arbitrary vectors generated.
 //! let header = fuzzers::HeaderC::arbitrary(&mut Gen::new(generate_range));
-//! println!("{}", header);
+//! println!("{header}");
 //! ```
 #![deny(missing_docs)]
 
@@ -103,5 +103,5 @@ pub fn test_bindgen(
     QuickCheck::new()
         .tests(tests)
         .gen(Gen::new(generate_range))
-        .quickcheck(bindgen_prop as fn(fuzzers::HeaderC) -> TestResult)
+        .quickcheck(bindgen_prop as fn(fuzzers::HeaderC) -> TestResult);
 }
diff --git a/bindgen-tests/tests/tests.rs b/bindgen-tests/tests/tests.rs
index 18262851..bbe7eb2e 100644
--- a/bindgen-tests/tests/tests.rs
+++ b/bindgen-tests/tests/tests.rs
@@ -359,7 +359,7 @@ macro_rules! test_header {
             });
 
             if let Err(err) = result {
-                panic!("{}", err);
+                panic!("{err}");
             }
         }
     };
diff --git a/bindgen/codegen/bitfield_unit_tests.rs b/bindgen/codegen/bitfield_unit_tests.rs
index 12b72048..ead0ffec 100644
--- a/bindgen/codegen/bitfield_unit_tests.rs
+++ b/bindgen/codegen/bitfield_unit_tests.rs
@@ -88,8 +88,8 @@ macro_rules! bitfield_unit_get {
                 let actual = unit.get($start, $len);
 
                 println!();
-                println!("expected = {:064b}", expected);
-                println!("actual   = {:064b}", actual);
+                println!("expected = {expected:064b}");
+                println!("actual   = {actual:064b}");
 
                 assert_eq!(expected, actual);
             })*
@@ -191,7 +191,7 @@ macro_rules! bitfield_unit_set {
                 println!();
                 println!("set({}, {}, {:032b}", $start, $len, $val);
                 println!("expected = {:064b}", $expected);
-                println!("actual   = {:064b}", actual);
+                println!("actual   = {actual:064b}");
 
                 assert_eq!($expected, actual);
             )*