From 1a0f6944e2cd65e586cd65c7e79482c3b1668a10 Mon Sep 17 00:00:00 2001 From: Sybrand Aarnoutse Date: Tue, 7 Jul 2026 19:27:39 +0200 Subject: [PATCH] Remove dependency on `memoffset` `memoffset::offset_of!` was stabilised as `core::mem::offset_of!` in rust 1.77 --- fyrox-core/Cargo.toml | 1 - fyrox-core/src/lib.rs | 3 --- fyrox-core/src/pool/mod.rs | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/fyrox-core/Cargo.toml b/fyrox-core/Cargo.toml index 97809b93e..093b54511 100644 --- a/fyrox-core/Cargo.toml +++ b/fyrox-core/Cargo.toml @@ -20,7 +20,6 @@ fyrox-math = { path = "../fyrox-math", version = "2.0.0-rc.1" } base64 = "0.22.1" byteorder = "1.4.3" rand = "0.8" -memoffset = "0.9.0" nalgebra = { version = "0.35", features = ["bytemuck", "convert-glam030"] } arrayvec = "0.7.2" futures = { version = "0.3.17", features = ["thread-pool"] } diff --git a/fyrox-core/src/lib.rs b/fyrox-core/src/lib.rs index 7d63d33fc..d864bcc72 100644 --- a/fyrox-core/src/lib.rs +++ b/fyrox-core/src/lib.rs @@ -27,9 +27,6 @@ #![allow(clippy::doc_lazy_continuation)] #![allow(mismatched_lifetime_syntaxes)] -#[macro_use] -extern crate memoffset; - pub use arrayvec; pub use byteorder; pub use nalgebra as algebra; diff --git a/fyrox-core/src/pool/mod.rs b/fyrox-core/src/pool/mod.rs index a8467168e..baebe43dc 100644 --- a/fyrox-core/src/pool/mod.rs +++ b/fyrox-core/src/pool/mod.rs @@ -1367,7 +1367,7 @@ where let val = ptr as *const T as usize; if val >= begin && val < end { let record_size = std::mem::size_of::>(); - let record_location = (val - offset_of!(PoolRecord, payload)) - begin; + let record_location = (val - core::mem::offset_of!(PoolRecord, payload)) - begin; if record_location.is_multiple_of(record_size) { let index = record_location / record_size; let index = u32::try_from(index).expect("Index overflowed u32");