forked from tokio-rs/tracing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Once to not violate feature additivity principle
When the following dependencies and their features were specified: ```toml tracing-core = { version = "0.1", default-features = false, features = ["std"] } tracing = { version = "0.1", default-features = false } ``` The build would fail with the following error: ``` error[E0412]: cannot find type `Once` in crate `tracing_core` --> tracing/src/lib.rs:840:35 | 840 | pub type Once = tracing_core::Once<()>; | ^^^^ not found in `tracing_core` | ``` This happened because `tracing-core` exports `Once` only if its `std` feature is disabled. And the depending `tracing` crate assumed that if its `std` feature was disabled, so would be the `std` feature in `tracing-core`. This is a violation of the [undocumented "features must be additive" guideline][ag]. In this commit tracing-core is adjusted to export `Once` regardless of whether `std` is disabled or not. [ag]: rust-lang/cargo#4328
- Loading branch information
Showing
4 changed files
with
7 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters