From e18cd56e7e31458d481ac6373b6ec3e07abf5878 Mon Sep 17 00:00:00 2001 From: Marcin Date: Mon, 25 Mar 2024 21:59:29 +0100 Subject: [PATCH] Conditionally re-export `alloc::sync` (#48) --- src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index ac0b999..870ed57 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,6 +44,15 @@ pub mod error; #[doc(hidden)] 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; pub use rand_helper::*;