Move error trait into core

This commit is contained in:
Jane Losare-Lusby
2022-07-29 18:54:47 +00:00
committed by Jane Lusby
parent e0dc8d7801
commit bf7611d55e
25 changed files with 1264 additions and 226 deletions

View File

@@ -1,6 +1,8 @@
//! Error types for conversion to integral types.
use crate::convert::Infallible;
#[cfg(not(bootstrap))]
use crate::error::Error;
use crate::fmt;
/// The error type returned when a checked integral type conversion fails.
@@ -144,3 +146,21 @@ impl fmt::Display for ParseIntError {
self.__description().fmt(f)
}
}
#[cfg(not(bootstrap))]
#[stable(feature = "rust1", since = "1.0.0")]
impl Error for ParseIntError {
#[allow(deprecated)]
fn description(&self) -> &str {
self.__description()
}
}
#[cfg(not(bootstrap))]
#[stable(feature = "try_from", since = "1.34.0")]
impl Error for TryFromIntError {
#[allow(deprecated)]
fn description(&self) -> &str {
self.__description()
}
}