From 8cc611c9bc8ff17031bf31278209bce3203714af Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 10 Nov 2025 18:06:51 -0500 Subject: [PATCH] replace memoffset with std::mem::offset_of! in pyo3-ffi-check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- pyo3-ffi-check/Cargo.toml | 1 - pyo3-ffi-check/src/main.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyo3-ffi-check/Cargo.toml b/pyo3-ffi-check/Cargo.toml index 874da3d2bef..cdf38c9f9bf 100644 --- a/pyo3-ffi-check/Cargo.toml +++ b/pyo3-ffi-check/Cargo.toml @@ -6,7 +6,6 @@ publish = false [dependencies] pyo3-ffi-check-macro = { path = "./macro" } -memoffset = "0.9.0" [dependencies.pyo3-ffi] path = "../pyo3-ffi" diff --git a/pyo3-ffi-check/src/main.rs b/pyo3-ffi-check/src/main.rs index 0407a2ffa39..3e887475d21 100644 --- a/pyo3-ffi-check/src/main.rs +++ b/pyo3-ffi-check/src/main.rs @@ -50,9 +50,9 @@ fn main() { ($struct_name:ident, $field:ident, $bindgen_field:ident) => {{ // some struct fields are deprecated but still present in the ABI #[allow(clippy::used_underscore_binding, deprecated)] - let pyo3_ffi_offset = memoffset::offset_of!(pyo3_ffi::$struct_name, $field); + let pyo3_ffi_offset = std::mem::offset_of!(pyo3_ffi::$struct_name, $field); #[allow(clippy::used_underscore_binding)] - let bindgen_offset = memoffset::offset_of!(bindings::$struct_name, $bindgen_field); + let bindgen_offset = std::mem::offset_of!(bindings::$struct_name, $bindgen_field); if pyo3_ffi_offset != bindgen_offset { failed = true;