diff --git a/console-subscriber/Cargo.toml b/console-subscriber/Cargo.toml index d3c414e3b..c5700e2d6 100644 --- a/console-subscriber/Cargo.toml +++ b/console-subscriber/Cargo.toml @@ -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] diff --git a/console-subscriber/src/lib.rs b/console-subscriber/src/lib.rs index 6b0c1a75e..dc3df66d2 100644 --- a/console-subscriber/src/lib.rs +++ b/console-subscriber/src/lib.rs @@ -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\"!"