diff --git a/packages/generational-box/src/lib.rs b/packages/generational-box/src/lib.rs index ac97937fd..5d4866d05 100644 --- a/packages/generational-box/src/lib.rs +++ b/packages/generational-box/src/lib.rs @@ -12,7 +12,7 @@ use std::{ sync::{atomic::AtomicU32, Arc}, }; -use bumpalo::Bump; +mod testing; /// # Example /// diff --git a/packages/generational-box/src/testing.rs b/packages/generational-box/src/testing.rs new file mode 100644 index 000000000..0f8db53dd --- /dev/null +++ b/packages/generational-box/src/testing.rs @@ -0,0 +1,44 @@ +use core::marker::PhantomData; + +#[test] +fn testing() { + let testing1 = Testing::<_, false>::new(&() as *const _); + // std::thread::spawn(move || testing1); +} + +struct Testing { + ptr: *mut (), + phantom: PhantomData, +} + +trait CreateNew { + fn new(data: T) -> Testing { + Testing { + ptr: &mut (), + phantom: PhantomData, + } + } +} + +impl CreateNew for Testing { + fn new(data: T) -> Testing { + Testing { + ptr: &mut (), + phantom: PhantomData, + } + } +} + +impl Testing { + pub fn new(data: T) -> Self { + Testing { + ptr: &mut (), + phantom: PhantomData, + } + } +} + +impl Testing {} + +unsafe impl Send for Testing {} +unsafe impl Sync for Testing {}