about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-06-20 16:28:25 -0400
committerGitHub <noreply@github.com>2017-06-20 16:28:25 -0400
commit4c43bc32b723f0727456e7d40fb5feeeb1c4d448 (patch)
treea5718919322009fbdddaca0ff3d955c2292e3470 /src/libstd
parent29bce6e220f6fd2292d13d65fe503af7bf4852b7 (diff)
parentfd9d7aa2cf76c949633cb4156642654238c03921 (diff)
downloadrust-4c43bc32b723f0727456e7d40fb5feeeb1c4d448.tar.gz
rust-4c43bc32b723f0727456e7d40fb5feeeb1c4d448.zip
Rollup merge of #42271 - tinaun:charfromstr, r=alexcrichton
add `FromStr` Impl for `char`

fixes #24939.

is it possible to use pub(restricted) instead of using a stability attribute for the internal error representation? is it needed at all?
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/error.rs8
-rw-r--r--src/libstd/lib.rs1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index 3d203429e7b..4b340f70fbc 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -340,6 +340,14 @@ impl Error for char::CharTryFromError {
     }
 }
 
+#[stable(feature = "char_from_str", since = "1.19.0")]
+impl Error for char::ParseCharError {
+    fn description(&self) -> &str {
+        self.__description()
+    }
+}
+
+
 // copied from any.rs
 impl Error + 'static {
     /// Returns true if the boxed type is the same as `T`
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 7c843711dbe..bafe23e80a0 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -254,6 +254,7 @@
 #![feature(cfg_target_thread_local)]
 #![feature(cfg_target_vendor)]
 #![feature(char_escape_debug)]
+#![feature(char_error_internals)]
 #![feature(char_internals)]
 #![feature(collections_range)]
 #![feature(compiler_builtins_lib)]