fix gen box compile release no features

This commit is contained in:
Jonathan Kelley 2024-01-23 15:41:37 -08:00
parent 84e76dbdce
commit 9633cfadde
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE
2 changed files with 3 additions and 4 deletions

View file

@ -2,7 +2,6 @@
#![warn(missing_docs)] #![warn(missing_docs)]
use parking_lot::Mutex; use parking_lot::Mutex;
use std::sync::atomic::AtomicU32;
use std::{ use std::{
fmt::Debug, fmt::Debug,
marker::PhantomData, marker::PhantomData,
@ -61,7 +60,7 @@ impl<T: 'static, S: AnyStorage> Debug for GenerationalBox<T, S> {
self.generation self.generation
))?; ))?;
#[cfg(not(any(debug_assertions, feature = "check_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(()) Ok(())
} }
} }
@ -183,7 +182,7 @@ impl<T: 'static, S: Storage<T>> GenerationalBox<T, S> {
} }
#[cfg(not(any(debug_assertions, feature = "check_generation")))] #[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<S = UnsyncStorage> {
data: S, data: S,
#[cfg(any(debug_assertions, feature = "check_generation"))] #[cfg(any(debug_assertions, feature = "check_generation"))]
generation: AtomicU32, generation: std::sync::atomic::AtomicU32,
#[cfg(any(debug_assertions, feature = "debug_borrows"))] #[cfg(any(debug_assertions, feature = "debug_borrows"))]
borrow: MemoryLocationBorrowInfo, borrow: MemoryLocationBorrowInfo,

View file