From f9f29814e3451757b254121115c9bb9f4a3fc253 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 9 Jan 2016 18:19:20 +0100 Subject: [PATCH] Impl Error for Box --- src/libstd/error.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libstd/error.rs b/src/libstd/error.rs index ee367193e456..660948b0acca 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 Error for Box { + 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`