File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ use crate::mem::transmute;
3030use crate :: num;
3131use crate :: str;
3232use crate :: string;
33+ use crate :: sync:: Arc ;
3334
3435/// `Error` is a trait representing the basic expectations for error values,
3536/// i.e., values of type `E` in [`Result<T, E>`]. Errors must describe
@@ -507,6 +508,27 @@ impl<'a, T: Error + ?Sized> Error for &'a T {
507508 }
508509}
509510
511+ #[ stable( feature = "arc_error" , since = "1.52.0" ) ]
512+ impl < T : Error + ?Sized > Error for Arc < T > {
513+ #[ allow( deprecated, deprecated_in_future) ]
514+ fn description ( & self ) -> & str {
515+ Error :: description ( & * * self )
516+ }
517+
518+ #[ allow( deprecated) ]
519+ fn cause ( & self ) -> Option < & dyn Error > {
520+ Error :: cause ( & * * self )
521+ }
522+
523+ fn source ( & self ) -> Option < & ( dyn Error + ' static ) > {
524+ Error :: source ( & * * self )
525+ }
526+
527+ fn backtrace ( & self ) -> Option < & Backtrace > {
528+ Error :: backtrace ( & * * self )
529+ }
530+ }
531+
510532#[ stable( feature = "fmt_error" , since = "1.11.0" ) ]
511533impl Error for fmt:: Error {
512534 #[ allow( deprecated) ]
You can’t perform that action at this time.
0 commit comments