diff --git a/tracing-subscriber/src/layer/mod.rs b/tracing-subscriber/src/layer/mod.rs index b4533771c5..bdc154301a 100644 --- a/tracing-subscriber/src/layer/mod.rs +++ b/tracing-subscriber/src/layer/mod.rs @@ -685,7 +685,7 @@ use core::any::TypeId; feature! { #![feature = "alloc"] - use alloc::{vec::Vec, boxed::Box}; + use alloc::boxed::Box; use core::ops::{Deref, DerefMut}; } @@ -1656,6 +1656,8 @@ where feature! { #![any(feature = "std", feature = "alloc")] + #[cfg(not(feature = "std"))] + use alloc::vec::Vec; macro_rules! layer_impl_body { () => { diff --git a/tracing-subscriber/src/registry/mod.rs b/tracing-subscriber/src/registry/mod.rs index 0f9fe76a1a..38af53e8ad 100644 --- a/tracing-subscriber/src/registry/mod.rs +++ b/tracing-subscriber/src/registry/mod.rs @@ -230,11 +230,6 @@ pub struct Scope<'a, R> { feature! { #![any(feature = "alloc", feature = "std")] - use alloc::{ - boxed::Box, - sync::Arc - }; - #[cfg(not(feature = "smallvec"))] use alloc::vec::{self, Vec}; @@ -256,66 +251,6 @@ feature! { #[cfg(feature = "smallvec")] type SpanRefVecArray<'span, L> = [SpanRef<'span, L>; 16]; - impl<'a, S> LookupSpan<'a> for Arc - where - S: LookupSpan<'a>, - { - type Data = >::Data; - - fn span_data(&'a self, id: &Id) -> Option { - self.as_ref().span_data(id) - } - - fn span(&'a self, id: &Id) -> Option> - where - Self: Sized, - { - self.as_ref().span(id).map( - |SpanRef { - registry: _, - data, - #[cfg(feature = "registry")] - filter, - }| SpanRef { - registry: self, - data, - #[cfg(feature = "registry")] - filter, - }, - ) - } - } - - impl<'a, S> LookupSpan<'a> for Box - where - S: LookupSpan<'a>, - { - type Data = >::Data; - - fn span_data(&'a self, id: &Id) -> Option { - self.as_ref().span_data(id) - } - - fn span(&'a self, id: &Id) -> Option> - where - Self: Sized, - { - self.as_ref().span(id).map( - |SpanRef { - registry: _, - data, - #[cfg(feature = "registry")] - filter, - }| SpanRef { - registry: self, - data, - #[cfg(feature = "registry")] - filter, - }, - ) - } - } - impl<'a, R> Scope<'a, R> where R: LookupSpan<'a>,