From 512e9a51cd00ba7b6d43e45df2f842b367f4e7bf Mon Sep 17 00:00:00 2001 From: polazarus Date: Sat, 9 Nov 2024 15:26:44 +0100 Subject: [PATCH] fix tests --- src/smart/tests.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/smart/tests.rs b/src/smart/tests.rs index 3eebef7..55d532a 100644 --- a/src/smart/tests.rs +++ b/src/smart/tests.rs @@ -1,5 +1,13 @@ #[cfg(not(loom))] -use std::{sync, thread}; +mod sync { + pub use alloc::sync::*; + pub use core::sync::*; + #[cfg(feature = "std")] + pub use std::sync::mpsc; +} + +#[cfg(feature = "std")] +use std::thread; #[cfg(loom)] use loom::{sync, thread}; @@ -289,6 +297,7 @@ fn loom_atomic_mt_clone_move_and_drop() { } #[test] +#[cfg(any(loom, feature = "std"))] fn test_atomic_mt_orderly_drop() { let (tx, rx) = sync::mpsc::channel(); let num = T::new(0); @@ -312,6 +321,7 @@ fn loom_atomic_mt_orderly_drop() { } #[test] +#[cfg(any(loom, feature = "std"))] fn test_atomic_mt_orderly_drop2() { let witness = atomic_witness::Witness::default(); let n0 = T::new(witness.clone());