From 6b007483b45c01dc8b2efabe6dcbf5e485afdc63 Mon Sep 17 00:00:00 2001 From: mmagician Date: Mon, 25 Mar 2024 18:45:13 +0100 Subject: [PATCH 1/2] conditionally re-export alloc::sync --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index ac0b999..025db62 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,6 +44,12 @@ pub mod error; #[doc(hidden)] pub use std::*; +#[cfg(target_has_atomic = "ptr")] +#[doc(hidden)] +pub mod sync { + pub use alloc::sync::*; +} + mod rand_helper; pub use rand_helper::*; From 29c65f964e72e43eaf242a8c6bc3ab36e5d31e37 Mon Sep 17 00:00:00 2001 From: mmagician Date: Mon, 25 Mar 2024 21:32:07 +0100 Subject: [PATCH 2/2] fix the std case --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 025db62..870ed57 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,7 +47,10 @@ pub use std::*; #[cfg(target_has_atomic = "ptr")] #[doc(hidden)] pub mod sync { + #[cfg(not(feature = "std"))] pub use alloc::sync::*; + #[cfg(feature = "std")] + pub use std::sync::*; } mod rand_helper;