Skip to content

Commit

Permalink
feat(subscriber): Add cfg console_without_tokio_unstable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ldm0 committed Jul 7, 2023
1 parent 7c8e80a commit 531f2ea
Showing 1 changed file with 1 addition and 0 deletions.
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(not(console_without_tokio_unstable))]
assert!(
cfg!(tokio_unstable),
"task tracing requires Tokio to be built with RUSTFLAGS=\"--cfg tokio_unstable\"!"
Expand Down

0 comments on commit 531f2ea

Please sign in to comment.