#![allow(missing_docs)]
use core::fmt::{Debug, Display};
pub trait Error: Debug + Display {
#[deprecated(since = "1.42.0", note = "use the Display impl or to_string()")]
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
#[deprecated(
since = "1.33.0",
note = "replaced by Error::source, which can support downcasting"
)]
fn cause(&self) -> Option<&dyn Error> {
self.source()
}
fn source(&self) -> Option<&(dyn Error + 'static)> {
None
}
}
macro_rules! impl_error {
($($e:path),*) => {
$(
impl Error for $e {}
)*
}
}
impl_error![
core::num::ParseFloatError, core::num::ParseIntError, core::str::ParseBoolError, core::str::Utf8Error, core::char::DecodeUtf16Error, core::fmt::Error, core::cell::BorrowError, core::cell::BorrowMutError, core::char::ParseCharError, core::array::TryFromSliceError, core::char::CharTryFromError, core::num::TryFromIntError ];