1
Fork 0

Implement TryFrom<u32> for char

For symmetry with From<char> for u32.
This commit is contained in:
Simon Sapin 2016-08-17 18:01:41 +02:00
parent 41d0a89e3a
commit f040208d53
5 changed files with 49 additions and 6 deletions

View file

@ -302,6 +302,13 @@ impl<'a, T: ?Sized + Reflect> Error for cell::BorrowMutError<'a, T> {
}
}
#[unstable(feature = "try_from", issue = "33417")]
impl Error for char::CharTryFromError {
fn description(&self) -> &str {
"converted integer out of range for `char`"
}
}
// copied from any.rs
impl Error + 'static {
/// Returns true if the boxed type is the same as `T`