allow_deprecated on stub Error::description for rust 1.13

This commit is contained in:
Brandon W Maister 2019-12-23 12:38:09 -05:00
parent a42c5b22cd
commit 977ad60391
2 changed files with 12 additions and 2 deletions

View File

@ -333,7 +333,12 @@ impl fmt::Display for ParseError {
}
#[cfg(any(feature = "std", test))]
impl Error for ParseError {}
impl Error for ParseError {
#[allow(deprecated)]
fn description(&self) -> &str {
"parser error, see to_string() for details"
}
}
// to be used in this module and submodules
const OUT_OF_RANGE: ParseError = ParseError(ParseErrorKind::OutOfRange);

View File

@ -400,7 +400,12 @@ impl fmt::Display for OutOfRangeError {
}
#[cfg(any(feature = "std", test))]
impl Error for OutOfRangeError {}
impl Error for OutOfRangeError {
#[allow(deprecated)]
fn description(&self) -> &str {
"out of range error"
}
}
// Copied from libnum
#[inline]