Skip to content

Commit d61b039

Browse files
authored
chore: fix warnings about unexpected cfg(feature) values (tokio-rs#2968)
* futures: Remove executor::futures_preview module The cfg for it was impossible to enable as of tokio-rs#441. * subscriber: Fix cfgs for nu-ansi-term Previously, enabling this optional dependency did not do anything. * Unconditionally ignore flaky tests No need to use a custom cfg to run off-by-default tests. * tower: Delete unused code It might be possible to make it work with tower_make instead, but that crate looks to be unmaintained (no longer present in the tower repo which is specified as the repository URL) so it should likely just be removed as a dependency.
1 parent 690a9a6 commit d61b039

File tree

6 files changed

+9
-164
lines changed

6 files changed

+9
-164
lines changed

tracing-futures/src/executor/futures_preview.rs

Lines changed: 0 additions & 121 deletions
This file was deleted.

tracing-futures/src/executor/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#[cfg(feature = "futures-01")]
22
mod futures_01;
33

4-
#[cfg(feature = "futures_preview")]
5-
mod futures_preview;
6-
#[cfg(feature = "futures_preview")]
7-
pub use self::futures_preview::*;
8-
94
#[cfg(feature = "futures-03")]
105
mod futures_03;
116
#[cfg(feature = "futures-03")]

tracing-subscriber/src/filter/env/builder.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,15 @@ impl Builder {
210210
}
211211

212212
if !disabled.is_empty() {
213-
#[cfg(feature = "nu_ansi_term")]
213+
#[cfg(feature = "nu-ansi-term")]
214214
use nu_ansi_term::{Color, Style};
215215
// NOTE: We can't use a configured `MakeWriter` because the EnvFilter
216216
// has no knowledge of any underlying subscriber or collector, which
217217
// may or may not use a `MakeWriter`.
218218
let warn = |msg: &str| {
219-
#[cfg(not(feature = "nu_ansi_term"))]
219+
#[cfg(not(feature = "nu-ansi-term"))]
220220
let msg = format!("warning: {}", msg);
221-
#[cfg(feature = "nu_ansi_term")]
221+
#[cfg(feature = "nu-ansi-term")]
222222
let msg = {
223223
let bold = Style::new().bold();
224224
let mut warning = Color::Yellow.paint("warning");
@@ -228,9 +228,9 @@ impl Builder {
228228
eprintln!("{}", msg);
229229
};
230230
let ctx_prefixed = |prefix: &str, msg: &str| {
231-
#[cfg(not(feature = "nu_ansi_term"))]
231+
#[cfg(not(feature = "nu-ansi-term"))]
232232
let msg = format!("{} {}", prefix, msg);
233-
#[cfg(feature = "nu_ansi_term")]
233+
#[cfg(feature = "nu-ansi-term")]
234234
let msg = {
235235
let mut equal = Color::Fixed(21).paint("="); // dark blue
236236
equal.style_ref_mut().is_bold = true;
@@ -241,9 +241,9 @@ impl Builder {
241241
let ctx_help = |msg| ctx_prefixed("help:", msg);
242242
let ctx_note = |msg| ctx_prefixed("note:", msg);
243243
let ctx = |msg: &str| {
244-
#[cfg(not(feature = "nu_ansi_term"))]
244+
#[cfg(not(feature = "nu-ansi-term"))]
245245
let msg = format!("note: {}", msg);
246-
#[cfg(feature = "nu_ansi_term")]
246+
#[cfg(feature = "nu-ansi-term")]
247247
let msg = {
248248
let mut pipe = Color::Fixed(21).paint("|");
249249
pipe.style_ref_mut().is_bold = true;

tracing-subscriber/tests/field_filter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use tracing_mock::*;
55
use tracing_subscriber::{filter::EnvFilter, prelude::*};
66

77
#[test]
8-
#[cfg_attr(not(flaky_tests), ignore)]
8+
#[ignore] // flaky, use `cargo test -- --ignored` or `--include-ignored` to run
99
fn field_filter_events() {
1010
let filter: EnvFilter = "[{thing}]=debug".parse().expect("filter should parse");
1111
let (subscriber, finished) = collector::mock()
@@ -35,7 +35,7 @@ fn field_filter_events() {
3535
}
3636

3737
#[test]
38-
#[cfg_attr(not(flaky_tests), ignore)]
38+
#[ignore] // flaky, use `cargo test -- --ignored` or `--include-ignored` to run
3939
fn field_filter_spans() {
4040
let filter: EnvFilter = "[{enabled=true}]=debug"
4141
.parse()

tracing-tower/src/lib.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -71,33 +71,8 @@ where
7171
}
7272
}
7373

74-
#[cfg(feature = "tower-util")]
75-
#[cfg_attr(docsrs, doc(cfg(feature = "tower-util")))]
76-
pub trait InstrumentMake<T, R>
77-
where
78-
Self: tower_util::MakeService<T, R> + Sized,
79-
{
80-
fn with_traced_service<G>(self, get_span: G) -> service_span::MakeService<Self, T, R, G>
81-
where
82-
G: GetSpan<T>,
83-
{
84-
service_span::MakeService::new(self, get_span)
85-
}
86-
87-
fn with_traced_requests<G>(self, get_span: G) -> request_span::MakeService<Self, R, G>
88-
where
89-
G: GetSpan<R> + Clone,
90-
{
91-
request_span::MakeService::new(self, get_span)
92-
}
93-
}
94-
9574
impl<S, R> InstrumentableService<R> for S where S: Service<R> + Sized {}
9675

97-
#[cfg(feature = "tower-util")]
98-
#[cfg_attr(docsrs, doc(cfg(feature = "tower-util")))]
99-
impl<M, T, R> InstrumentMake<T, R> for M where M: tower_util::MakeService<T, R> {}
100-
10176
pub trait GetSpan<T>: crate::sealed::Sealed<T> {
10277
fn span_for(&self, target: &T) -> tracing::Span;
10378
}

tracing-tower/src/service_span.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ pub struct Service<S> {
1616
#[cfg_attr(docsrs, doc(cfg(feature = "tower-layer")))]
1717
pub use self::layer::*;
1818

19-
#[cfg(feature = "tower-util")]
20-
#[cfg_attr(docsrs, doc(cfg(feature = "tower-util")))]
21-
pub use self::make::MakeService;
22-
2319
#[cfg(feature = "tower-layer")]
2420
#[cfg_attr(docsrs, doc(cfg(feature = "tower-layer")))]
2521
mod layer {

0 commit comments

Comments
 (0)