diff --git a/tracing-futures/src/executor/futures_preview.rs b/tracing-futures/src/executor/futures_preview.rs deleted file mode 100644 index fec9e3fadb..0000000000 --- a/tracing-futures/src/executor/futures_preview.rs +++ /dev/null @@ -1,121 +0,0 @@ -use crate::{Instrument, Instrumented, WithDispatch}; -use core::future::Future; -use futures_core_preview::{ - future::FutureObj, - task::{LocalSpawn, Spawn, SpawnError}, -}; - -impl Spawn for Instrumented -where - T: Spawn, -{ - /// Spawns a future that will be run to completion. - /// - /// # Errors - /// - /// The executor may be unable to spawn tasks. Spawn errors should - /// represent relatively rare scenarios, such as the executor - /// having been shut down so that it is no longer able to accept - /// tasks. - fn spawn_obj(&mut self, future: FutureObj<'static, ()>) -> Result<(), SpawnError> { - let future = future.instrument(self.span.clone()); - self.inner.spawn_obj(Box::pin(future)) - } - - /// Determines whether the executor is able to spawn new tasks. - /// - /// This method will return `Ok` when the executor is *likely* - /// (but not guaranteed) to accept a subsequent spawn attempt. - /// Likewise, an `Err` return means that `spawn` is likely, but - /// not guaranteed, to yield an error. - #[inline] - fn status(&self) -> Result<(), SpawnError> { - self.inner.status() - } -} - -impl Spawn for WithDispatch -where - T: Spawn, -{ - /// Spawns a future that will be run to completion. - /// - /// # Errors - /// - /// The executor may be unable to spawn tasks. Spawn errors should - /// represent relatively rare scenarios, such as the executor - /// having been shut down so that it is no longer able to accept - /// tasks. - fn spawn_obj(&mut self, future: FutureObj<'static, ()>) -> Result<(), SpawnError> { - self.inner.spawn_obj(Box::pin(self.with_dispatch(future))) - } - - /// Determines whether the executor is able to spawn new tasks. - /// - /// This method will return `Ok` when the executor is *likely* - /// (but not guaranteed) to accept a subsequent spawn attempt. - /// Likewise, an `Err` return means that `spawn` is likely, but - /// not guaranteed, to yield an error. - #[inline] - fn status(&self) -> Result<(), SpawnError> { - self.inner.status() - } -} - -impl LocalSpawn for Instrumented -where - T: LocalSpawn, -{ - /// Spawns a future that will be run to completion. - /// - /// # Errors - /// - /// The executor may be unable to spawn tasks. Spawn errors should - /// represent relatively rare scenarios, such as the executor - /// having been shut down so that it is no longer able to accept - /// tasks. - fn spawn_local_obj(&mut self, future: LocalFutureObj<'static, ()>) -> Result<(), SpawnError> { - let future = future.instrument(self.span.clone()); - self.inner.spawn_local_obj(Box::pin(future)) - } - - /// Determines whether the executor is able to spawn new tasks. - /// - /// This method will return `Ok` when the executor is *likely* - /// (but not guaranteed) to accept a subsequent spawn attempt. - /// Likewise, an `Err` return means that `spawn` is likely, but - /// not guaranteed, to yield an error. - #[inline] - fn status_local(&self) -> Result<(), SpawnError> { - self.inner.status_local() - } -} - -impl LocalSpawn for WithDispatch -where - T: Spawn, -{ - /// Spawns a future that will be run to completion. - /// - /// # Errors - /// - /// The executor may be unable to spawn tasks. Spawn errors should - /// represent relatively rare scenarios, such as the executor - /// having been shut down so that it is no longer able to accept - /// tasks. - fn spawn_local_obj(&mut self, future: LocalFutureObj<'static, ()>) -> Result<(), SpawnError> { - self.inner - .spawn_local_obj(Box::pin(self.with_dispatch(future))) - } - - /// Determines whether the executor is able to spawn new tasks. - /// - /// This method will return `Ok` when the executor is *likely* - /// (but not guaranteed) to accept a subsequent spawn attempt. - /// Likewise, an `Err` return means that `spawn` is likely, but - /// not guaranteed, to yield an error. - #[inline] - fn status_local(&self) -> Result<(), SpawnError> { - self.inner.status_local() - } -} diff --git a/tracing-futures/src/executor/mod.rs b/tracing-futures/src/executor/mod.rs index ced3b5a460..86bad9379c 100644 --- a/tracing-futures/src/executor/mod.rs +++ b/tracing-futures/src/executor/mod.rs @@ -1,11 +1,6 @@ #[cfg(feature = "futures-01")] mod futures_01; -#[cfg(feature = "futures_preview")] -mod futures_preview; -#[cfg(feature = "futures_preview")] -pub use self::futures_preview::*; - #[cfg(feature = "futures-03")] mod futures_03; #[cfg(feature = "futures-03")] diff --git a/tracing-subscriber/src/filter/env/builder.rs b/tracing-subscriber/src/filter/env/builder.rs index ebb7b45e72..8d126af2de 100644 --- a/tracing-subscriber/src/filter/env/builder.rs +++ b/tracing-subscriber/src/filter/env/builder.rs @@ -210,15 +210,15 @@ impl Builder { } if !disabled.is_empty() { - #[cfg(feature = "nu_ansi_term")] + #[cfg(feature = "nu-ansi-term")] use nu_ansi_term::{Color, Style}; // NOTE: We can't use a configured `MakeWriter` because the EnvFilter // has no knowledge of any underlying subscriber or collector, which // may or may not use a `MakeWriter`. let warn = |msg: &str| { - #[cfg(not(feature = "nu_ansi_term"))] + #[cfg(not(feature = "nu-ansi-term"))] let msg = format!("warning: {}", msg); - #[cfg(feature = "nu_ansi_term")] + #[cfg(feature = "nu-ansi-term")] let msg = { let bold = Style::new().bold(); let mut warning = Color::Yellow.paint("warning"); @@ -228,9 +228,9 @@ impl Builder { eprintln!("{}", msg); }; let ctx_prefixed = |prefix: &str, msg: &str| { - #[cfg(not(feature = "nu_ansi_term"))] + #[cfg(not(feature = "nu-ansi-term"))] let msg = format!("{} {}", prefix, msg); - #[cfg(feature = "nu_ansi_term")] + #[cfg(feature = "nu-ansi-term")] let msg = { let mut equal = Color::Fixed(21).paint("="); // dark blue equal.style_ref_mut().is_bold = true; @@ -241,9 +241,9 @@ impl Builder { let ctx_help = |msg| ctx_prefixed("help:", msg); let ctx_note = |msg| ctx_prefixed("note:", msg); let ctx = |msg: &str| { - #[cfg(not(feature = "nu_ansi_term"))] + #[cfg(not(feature = "nu-ansi-term"))] let msg = format!("note: {}", msg); - #[cfg(feature = "nu_ansi_term")] + #[cfg(feature = "nu-ansi-term")] let msg = { let mut pipe = Color::Fixed(21).paint("|"); pipe.style_ref_mut().is_bold = true; diff --git a/tracing-subscriber/tests/field_filter.rs b/tracing-subscriber/tests/field_filter.rs index 7aaa767184..17b6a75b4b 100644 --- a/tracing-subscriber/tests/field_filter.rs +++ b/tracing-subscriber/tests/field_filter.rs @@ -5,7 +5,7 @@ use tracing_mock::*; use tracing_subscriber::{filter::EnvFilter, prelude::*}; #[test] -#[cfg_attr(not(flaky_tests), ignore)] +#[ignore] // flaky, use `cargo test -- --ignored` or `--include-ignored` to run fn field_filter_events() { let filter: EnvFilter = "[{thing}]=debug".parse().expect("filter should parse"); let (subscriber, finished) = collector::mock() @@ -35,7 +35,7 @@ fn field_filter_events() { } #[test] -#[cfg_attr(not(flaky_tests), ignore)] +#[ignore] // flaky, use `cargo test -- --ignored` or `--include-ignored` to run fn field_filter_spans() { let filter: EnvFilter = "[{enabled=true}]=debug" .parse() diff --git a/tracing-tower/src/lib.rs b/tracing-tower/src/lib.rs index 4f06044d29..cd8449065b 100644 --- a/tracing-tower/src/lib.rs +++ b/tracing-tower/src/lib.rs @@ -71,33 +71,8 @@ where } } -#[cfg(feature = "tower-util")] -#[cfg_attr(docsrs, doc(cfg(feature = "tower-util")))] -pub trait InstrumentMake -where - Self: tower_util::MakeService + Sized, -{ - fn with_traced_service(self, get_span: G) -> service_span::MakeService - where - G: GetSpan, - { - service_span::MakeService::new(self, get_span) - } - - fn with_traced_requests(self, get_span: G) -> request_span::MakeService - where - G: GetSpan + Clone, - { - request_span::MakeService::new(self, get_span) - } -} - impl InstrumentableService for S where S: Service + Sized {} -#[cfg(feature = "tower-util")] -#[cfg_attr(docsrs, doc(cfg(feature = "tower-util")))] -impl InstrumentMake for M where M: tower_util::MakeService {} - pub trait GetSpan: crate::sealed::Sealed { fn span_for(&self, target: &T) -> tracing::Span; } diff --git a/tracing-tower/src/service_span.rs b/tracing-tower/src/service_span.rs index 95d74db998..464cd25355 100644 --- a/tracing-tower/src/service_span.rs +++ b/tracing-tower/src/service_span.rs @@ -16,10 +16,6 @@ pub struct Service { #[cfg_attr(docsrs, doc(cfg(feature = "tower-layer")))] pub use self::layer::*; -#[cfg(feature = "tower-util")] -#[cfg_attr(docsrs, doc(cfg(feature = "tower-util")))] -pub use self::make::MakeService; - #[cfg(feature = "tower-layer")] #[cfg_attr(docsrs, doc(cfg(feature = "tower-layer")))] mod layer {