File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed
Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 1- use std:: fmt:: { self , Formatter } ;
1+ use std:: {
2+ fmt:: { self , Formatter } ,
3+ sync:: Arc ,
4+ } ;
25
36use crate :: { AnyError , Location , Meta , backtrace_enabled} ;
47
@@ -353,3 +356,33 @@ impl_stack_error_for_std_error!(std::str::Utf8Error);
353356impl_stack_error_for_std_error ! ( std:: string:: FromUtf8Error ) ;
354357impl_stack_error_for_std_error ! ( std:: net:: AddrParseError ) ;
355358impl_stack_error_for_std_error ! ( std:: array:: TryFromSliceError ) ;
359+
360+ impl < T : StackError + std:: error:: Error + Sized + ' static > StackError for Arc < T > {
361+ fn as_std ( & self ) -> & ( dyn std:: error:: Error + Send + Sync + ' static ) {
362+ ( * * self ) . as_std ( )
363+ }
364+
365+ fn into_std ( self : Box < Self > ) -> Box < dyn std:: error:: Error + Send + Sync > {
366+ self
367+ }
368+
369+ fn as_dyn ( & self ) -> & dyn StackError {
370+ ( * * self ) . as_dyn ( )
371+ }
372+
373+ fn meta ( & self ) -> Option < & Meta > {
374+ ( * * self ) . meta ( )
375+ }
376+
377+ fn source ( & self ) -> Option < ErrorRef < ' _ > > {
378+ StackError :: source ( & * * self )
379+ }
380+
381+ fn fmt_message ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
382+ ( * * self ) . fmt_message ( f)
383+ }
384+
385+ fn is_transparent ( & self ) -> bool {
386+ ( * * self ) . is_transparent ( )
387+ }
388+ }
You can’t perform that action at this time.
0 commit comments