Skip to content

Commit

Permalink
Stop using implicit dependency features
Browse files Browse the repository at this point in the history
Our optional dependencies were implicitly defining features of the same
name, as that is how Cargo opted to do things. The behavior is weird and
confusing and probably best avoided. With version 1.60 of Cargo, we can
opt out by making actual features depend on said optional dependencies
via dep:<name> syntax [0].
With this change we do just that.

[0] https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies
  • Loading branch information
d-e-s-o committed Apr 29, 2024
1 parent 5d5ed5c commit 538e5ef
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ required-features = ["log", "unstable"]

[features]
default = ["log", "color"]
# TODO: use "dep:{tracing-subscriber,evn_logger}" once our MSRV is 1.60 or higher.
trace = ["tracing-subscriber", "test-log-macros/trace"]
log = ["env_logger", "test-log-macros/log", "tracing-subscriber?/tracing-log"]
trace = ["dep:tracing-subscriber", "test-log-macros/trace"]
log = ["dep:env_logger", "test-log-macros/log", "tracing-subscriber?/tracing-log"]
color = ["env_logger?/auto-color", "tracing-subscriber?/ansi"]
# Enable unstable features. These are generally exempt from any semantic
# versioning guarantees.
Expand Down

0 comments on commit 538e5ef

Please sign in to comment.