diff options
| author | bors <bors@rust-lang.org> | 2016-02-04 00:39:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-02-04 00:39:55 +0000 |
| commit | 3c9442fc503fe397b8d3495d5a7f9e599ad63cf6 (patch) | |
| tree | 9a6927f1f88cbffe39cb57c780499a88933c1356 | |
| parent | e3bcddb44bc810ddf5b0443e45e42a835d17d868 (diff) | |
| parent | f9f29814e3451757b254121115c9bb9f4a3fc253 (diff) | |
| download | rust-3c9442fc503fe397b8d3495d5a7f9e599ad63cf6.tar.gz rust-3c9442fc503fe397b8d3495d5a7f9e599ad63cf6.zip | |
Auto merge of #30796 - GuillaumeGomez:impl_box_error, r=alexcrichton
Fixes #30349
| -rw-r--r-- | src/libstd/error.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs index ee367193e45..660948b0acc 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -189,6 +189,17 @@ impl Error for string::ParseError { } } +#[stable(feature = "box_error", since = "1.7.0")] +impl<T: Error> Error for Box<T> { + fn description(&self) -> &str { + Error::description(&**self) + } + + fn cause(&self) -> Option<&Error> { + Error::cause(&**self) + } +} + // copied from any.rs impl Error + 'static { /// Returns true if the boxed type is the same as `T` |
