diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index ad9c770a5a5ca..d9cbc4488fca7 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -1692,6 +1692,13 @@ impl fmt::Debug for ParseError { } } +#[stable(feature = "str_parse_error2", since = "1.8.0")] +impl fmt::Display for ParseError { + fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { + match *self {} + } +} + #[stable(feature = "str_parse_error", since = "1.5.0")] impl PartialEq for ParseError { fn eq(&self, _: &ParseError) -> bool { diff --git a/src/libstd/error.rs b/src/libstd/error.rs index c44a4bfe0f161..ee367193e456b 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -182,6 +182,13 @@ impl Error for string::FromUtf16Error { } } +#[stable(feature = "str_parse_error2", since = "1.8.0")] +impl Error for string::ParseError { + fn description(&self) -> &str { + match *self {} + } +} + // copied from any.rs impl Error + 'static { /// Returns true if the boxed type is the same as `T`