From 9633cfaddea98bc35f61d3a137ce58728ef267f8 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Tue, 23 Jan 2024 15:41:37 -0800 Subject: [PATCH] fix gen box compile release no features --- packages/generational-box/src/lib.rs | 7 +++---- packages/generational-box/src/owner.rs | 0 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 packages/generational-box/src/owner.rs diff --git a/packages/generational-box/src/lib.rs b/packages/generational-box/src/lib.rs index 268569b10..4f7ae6dfa 100644 --- a/packages/generational-box/src/lib.rs +++ b/packages/generational-box/src/lib.rs @@ -2,7 +2,6 @@ #![warn(missing_docs)] use parking_lot::Mutex; -use std::sync::atomic::AtomicU32; use std::{ fmt::Debug, marker::PhantomData, @@ -61,7 +60,7 @@ impl Debug for GenerationalBox { self.generation ))?; #[cfg(not(any(debug_assertions, feature = "check_generation")))] - f.write_fmt(format_args!("{:?}", self.raw.0.data.as_ptr()))?; + f.write_fmt(format_args!("{:?}", self.raw.0.data.data_ptr()))?; Ok(()) } } @@ -183,7 +182,7 @@ impl> GenerationalBox { } #[cfg(not(any(debug_assertions, feature = "check_generation")))] { - self.raw.data.as_ptr() == other.raw.data.as_ptr() + self.raw.0.data.data_ptr() == other.raw.0.data.data_ptr() } } } @@ -313,7 +312,7 @@ struct MemoryLocationInner { data: S, #[cfg(any(debug_assertions, feature = "check_generation"))] - generation: AtomicU32, + generation: std::sync::atomic::AtomicU32, #[cfg(any(debug_assertions, feature = "debug_borrows"))] borrow: MemoryLocationBorrowInfo, diff --git a/packages/generational-box/src/owner.rs b/packages/generational-box/src/owner.rs new file mode 100644 index 000000000..e69de29bb