Skip to content

Commit

Permalink
Impl Error for Box<T: Error>
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jan 23, 2016
1 parent 0486e12 commit f9f2981
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/libstd/error.rs
Expand Up @@ -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`
Expand Down

0 comments on commit f9f2981

Please sign in to comment.