@@ -230,6 +230,11 @@ pub struct Scope<'a, R> {
230230feature ! {
231231 #![ any( feature = "alloc" , feature = "std" ) ]
232232
233+ use alloc:: {
234+ boxed:: Box ,
235+ sync:: Arc
236+ } ;
237+
233238 #[ cfg( not( feature = "smallvec" ) ) ]
234239 use alloc:: vec:: { self , Vec } ;
235240
@@ -251,6 +256,66 @@ feature! {
251256 #[ cfg( feature = "smallvec" ) ]
252257 type SpanRefVecArray <' span, L > = [ SpanRef <' span, L >; 16 ] ;
253258
259+ impl <' a, S > LookupSpan <' a> for Arc <S >
260+ where
261+ S : LookupSpan <' a>,
262+ {
263+ type Data = <S as LookupSpan <' a>>:: Data ;
264+
265+ fn span_data( & ' a self , id: & Id ) -> Option <Self :: Data > {
266+ self . as_ref( ) . span_data( id)
267+ }
268+
269+ fn span( & ' a self , id: & Id ) -> Option <SpanRef <' _, Self >>
270+ where
271+ Self : Sized ,
272+ {
273+ self . as_ref( ) . span( id) . map(
274+ |SpanRef {
275+ registry: _,
276+ data,
277+ #[ cfg( feature = "registry" ) ]
278+ filter,
279+ } | SpanRef {
280+ registry: self ,
281+ data,
282+ #[ cfg( feature = "registry" ) ]
283+ filter,
284+ } ,
285+ )
286+ }
287+ }
288+
289+ impl <' a, S > LookupSpan <' a> for Box <S >
290+ where
291+ S : LookupSpan <' a>,
292+ {
293+ type Data = <S as LookupSpan <' a>>:: Data ;
294+
295+ fn span_data( & ' a self , id: & Id ) -> Option <Self :: Data > {
296+ self . as_ref( ) . span_data( id)
297+ }
298+
299+ fn span( & ' a self , id: & Id ) -> Option <SpanRef <' _, Self >>
300+ where
301+ Self : Sized ,
302+ {
303+ self . as_ref( ) . span( id) . map(
304+ |SpanRef {
305+ registry: _,
306+ data,
307+ #[ cfg( feature = "registry" ) ]
308+ filter,
309+ } | SpanRef {
310+ registry: self ,
311+ data,
312+ #[ cfg( feature = "registry" ) ]
313+ filter,
314+ } ,
315+ )
316+ }
317+ }
318+
254319 impl <' a, R > Scope <' a, R >
255320 where
256321 R : LookupSpan <' a>,
0 commit comments