diff options
| author | bors <bors@rust-lang.org> | 2016-01-23 04:04:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-01-23 04:04:26 +0000 |
| commit | 93d03edcb83d025ef40bd169ebf99214548d987f (patch) | |
| tree | dcc55fb234254da619d90eab79015380063e0ecd /src/libstd | |
| parent | d63b8e539ff1605cfe2ea3c1893139bd77e3bb8d (diff) | |
| parent | 365deeb19a2cff74e3d215622b1ab411581b99e9 (diff) | |
| download | rust-93d03edcb83d025ef40bd169ebf99214548d987f.tar.gz rust-93d03edcb83d025ef40bd169ebf99214548d987f.zip | |
Auto merge of #31124 - dirk:dirk/display-and-error-impls-for-string-parse-error, r=alexcrichton
Fixes #31106. - [ ] I wasn't sure of the correct `#[stable(...)]` definition to use here. Happy to fix it if it's incorrect. - [ ] `ParseError` is sort of an ephemeral non-error, but do let me know if the implementation of `error::Error` for it should return something more descriptive than "parse error".
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/error.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs index c44a4bfe0f1..ee367193e45 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` |
