You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
core: adjust Once to not violate feature additivity principle (#760)
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
0 commit comments