Add impl Error
for Arc
This commit is contained in:
parent
8a9f7862bc
commit
0d6640a5b0
@ -30,6 +30,7 @@ use crate::mem::transmute;
|
||||
use crate::num;
|
||||
use crate::str;
|
||||
use crate::string;
|
||||
use crate::sync::Arc;
|
||||
|
||||
/// `Error` is a trait representing the basic expectations for error values,
|
||||
/// 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 {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "arc_error", since = "1.52.0")]
|
||||
impl<T: Error + ?Sized> Error for Arc<T> {
|
||||
#[allow(deprecated, deprecated_in_future)]
|
||||
fn description(&self) -> &str {
|
||||
Error::description(&**self)
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
fn cause(&self) -> Option<&dyn Error> {
|
||||
Error::cause(&**self)
|
||||
}
|
||||
|
||||
fn source(&self) -> Option<&(dyn Error + 'static)> {
|
||||
Error::source(&**self)
|
||||
}
|
||||
|
||||
fn backtrace(&self) -> Option<&Backtrace> {
|
||||
Error::backtrace(&**self)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "fmt_error", since = "1.11.0")]
|
||||
impl Error for fmt::Error {
|
||||
#[allow(deprecated)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user