diff --git a/tracing-subscriber/src/filter/directive.rs b/tracing-subscriber/src/filter/directive.rs index c56147c6ef..dd6b063c4a 100644 --- a/tracing-subscriber/src/filter/directive.rs +++ b/tracing-subscriber/src/filter/directive.rs @@ -1,9 +1,9 @@ use crate::filter::level::{self, LevelFilter}; +#[cfg(not(feature = "smallvec"))] +use alloc::vec; #[cfg(not(feature = "std"))] -use alloc::{ - string::String, - vec::{self, Vec}, -}; +use alloc::{string::String, vec::Vec}; + use core::{cmp::Ordering, fmt, iter::FromIterator, slice, str::FromStr}; use tracing_core::Metadata; /// Indicates that a string could not be parsed as a filtering directive. diff --git a/tracing-subscriber/src/registry/mod.rs b/tracing-subscriber/src/registry/mod.rs index b2a6af4ab3..1eadc16045 100644 --- a/tracing-subscriber/src/registry/mod.rs +++ b/tracing-subscriber/src/registry/mod.rs @@ -234,8 +234,9 @@ pub struct Scope<'a, R> { feature! { #![any(feature = "alloc", feature = "std")] - #[cfg(not(feature = "std"))] + #[cfg(not(feature = "smallvec"))] use alloc::vec::{self, Vec}; + use core::{fmt,iter}; /// An iterator over the parents of a span, ordered from root to leaf.