about summary refs log tree commit diff
path: root/src/libstd/error.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2016-08-17 18:01:41 +0200
committerSimon Sapin <simon.sapin@exyr.org>2016-08-29 17:34:02 +0200
commitf040208d533e1d6d9ee0e0408ee74e26e14d1284 (patch)
tree5592063ace04a7f2016e6398094b66b7e4ad521b /src/libstd/error.rs
parent41d0a89e3ad99a9fdf700ea7d15750fe1cbfab14 (diff)
downloadrust-f040208d533e1d6d9ee0e0408ee74e26e14d1284.tar.gz
rust-f040208d533e1d6d9ee0e0408ee74e26e14d1284.zip
Implement TryFrom<u32> for char
For symmetry with From<char> for u32.
Diffstat (limited to 'src/libstd/error.rs')
-rw-r--r--src/libstd/error.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index ab537f39bf9..16290620010 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -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`