File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -506,6 +506,27 @@ impl<T: Error> Error for Box<T> {
506506 }
507507}
508508
509+ #[ stable( feature = "error_by_ref" , since = "1.47.0" ) ]
510+ impl < ' a , T : Error + ?Sized > Error for & ' a T {
511+ #[ allow( deprecated, deprecated_in_future) ]
512+ fn description ( & self ) -> & str {
513+ Error :: description ( & * * self )
514+ }
515+
516+ #[ allow( deprecated) ]
517+ fn cause ( & self ) -> Option < & dyn Error > {
518+ Error :: cause ( & * * self )
519+ }
520+
521+ fn source ( & self ) -> Option < & ( dyn Error + ' static ) > {
522+ Error :: source ( & * * self )
523+ }
524+
525+ fn backtrace ( & self ) -> Option < & Backtrace > {
526+ Error :: backtrace ( & * * self )
527+ }
528+ }
529+
509530#[ stable( feature = "fmt_error" , since = "1.11.0" ) ]
510531impl Error for fmt:: Error {
511532 #[ allow( deprecated) ]
You can’t perform that action at this time.
0 commit comments