From e9fbd47ef01adfeb43cbee97f27a102c14f5297a Mon Sep 17 00:00:00 2001 From: Liu Dingming Date: Sat, 8 Jul 2023 00:48:12 +0800 Subject: [PATCH] feat(subscriber): Add cfg `console_without_tokio_unstable` Add cfg `console_without_tokio_unstable` for developers to turn off the assertion on `tokio_unstable`. This is useful for non-tokio runtimes which has `tokio-console` support. --- console-subscriber/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/console-subscriber/src/lib.rs b/console-subscriber/src/lib.rs index 6b0c1a75e..18db72b84 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(not(console_without_tokio_unstable))] assert!( cfg!(tokio_unstable), "task tracing requires Tokio to be built with RUSTFLAGS=\"--cfg tokio_unstable\"!"