diff --git a/tracing-core/src/lazy_static/core_lazy.rs b/tracing-core/src/lazy_static/core_lazy.rs index 56cfe24ce3..c61d36202d 100644 --- a/tracing-core/src/lazy_static/core_lazy.rs +++ b/tracing-core/src/lazy_static/core_lazy.rs @@ -5,7 +5,7 @@ // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. -use crate::Once; +use crate::spin::Once; pub(crate) struct Lazy(Once); diff --git a/tracing-core/src/lib.rs b/tracing-core/src/lib.rs index 9658eb75ae..4079984f41 100644 --- a/tracing-core/src/lib.rs +++ b/tracing-core/src/lib.rs @@ -226,7 +226,10 @@ pub(crate) mod spin; #[cfg(not(feature = "std"))] #[doc(hidden)] -pub use self::spin::Once; +pub type Once = self::spin::Once<()>; + +#[cfg(feature = "std")] +pub use stdlib::sync::Once; pub mod callsite; pub mod dispatcher; diff --git a/tracing-core/src/spin/mod.rs b/tracing-core/src/spin/mod.rs index 767fcf649b..148b192b34 100644 --- a/tracing-core/src/spin/mod.rs +++ b/tracing-core/src/spin/mod.rs @@ -1,7 +1,7 @@ //! Synchronization primitives based on spinning pub(crate) use mutex::*; -pub use once::Once; +pub(crate) use once::Once; mod mutex; mod once; diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs index d6a4978c45..ec91df8776 100644 --- a/tracing/src/lib.rs +++ b/tracing/src/lib.rs @@ -832,12 +832,7 @@ pub mod subscriber; #[doc(hidden)] pub mod __macro_support { pub use crate::stdlib::sync::atomic::{AtomicUsize, Ordering}; - - #[cfg(feature = "std")] - pub use crate::stdlib::sync::Once; - - #[cfg(not(feature = "std"))] - pub type Once = tracing_core::Once<()>; + pub type Once = tracing_core::Once; } mod sealed {