/// }
///
/// impl Error for SuperError {
- /// fn description(&self) -> &str {
- /// "I'm the superhero of errors"
- /// }
- ///
/// fn cause(&self) -> Option<&dyn Error> {
/// Some(&self.side)
/// }
/// }
/// }
///
- /// impl Error for SuperErrorSideKick {
- /// fn description(&self) -> &str {
- /// "I'm SuperError side kick"
- /// }
- /// }
+ /// impl Error for SuperErrorSideKick {}
///
/// fn get_super_error() -> Result<(), SuperError> {
/// Err(SuperError { side: SuperErrorSideKick })
/// }
///
/// impl Error for SuperError {
- /// fn description(&self) -> &str {
- /// "I'm the superhero of errors"
- /// }
- ///
/// fn source(&self) -> Option<&(dyn Error + 'static)> {
/// Some(&self.side)
/// }
/// }
/// }
///
- /// impl Error for SuperErrorSideKick {
- /// fn description(&self) -> &str {
- /// "I'm SuperError side kick"
- /// }
- /// }
+ /// impl Error for SuperErrorSideKick {}
///
/// fn get_super_error() -> Result<(), SuperError> {
/// Err(SuperError { side: SuperErrorSideKick })
/// }
/// }
///
- /// impl Error for AnError {
- /// fn description(&self) -> &str {
- /// "Description of an error"
- /// }
- /// }
+ /// impl Error for AnError {}
///
/// let an_error = AnError;
/// assert!(0 == mem::size_of_val(&an_error));
/// }
/// }
///
- /// impl Error for AnError {
- /// fn description(&self) -> &str {
- /// "Description of an error"
- /// }
- /// }
+ /// impl Error for AnError {}
///
/// unsafe impl Send for AnError {}
///
}
}
-#[stable(feature = "never_type", since = "1.41.0")]
+#[unstable(feature = "never_type", issue = "35121")]
impl Error for ! {
fn description(&self) -> &str { *self }
}
}
}
+#[stable(feature = "str_parse_error2", since = "1.8.0")]
+impl Error for string::ParseError {
+ fn description(&self) -> &str {
+ match *self {}
+ }
+}
+
#[stable(feature = "decode_utf16", since = "1.9.0")]
impl Error for char::DecodeUtf16Error {
fn description(&self) -> &str {