Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Once to not violate feature additivity principle #760

Merged
merged 1 commit into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tracing-core/src/lazy_static/core_lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: Sync>(Once<T>);

Expand Down
5 changes: 4 additions & 1 deletion tracing-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tracing-core/src/spin/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
7 changes: 1 addition & 6 deletions tracing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down