Skip to content

Commit

Permalink
Add tokio_unstable_assertion to make cfg assertion optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ldm0 committed Jul 7, 2023
1 parent 7c8e80a commit 0e6d4cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion console-subscriber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ keywords = [
]

[features]
default = ["env-filter"]
default = ["env-filter", "tokio_unstable_assertion"]
parking_lot = ["parking_lot_crate", "tracing-subscriber/parking_lot"]
env-filter = ["tracing-subscriber/env-filter"]
tokio_unstable_assertion = []

[dependencies]

Expand Down
1 change: 1 addition & 0 deletions console-subscriber/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ impl ConsoleLayer {
// The `cfg` value *appears* to be a constant to clippy, but it changes
// depending on the build-time configuration...
#![allow(clippy::assertions_on_constants)]
#[cfg(feature = "tokio_unstable_assertion")]
assert!(
cfg!(tokio_unstable),
"task tracing requires Tokio to be built with RUSTFLAGS=\"--cfg tokio_unstable\"!"
Expand Down

0 comments on commit 0e6d4cf

Please sign in to comment.