Skip to content

Commit 3c9442f

Browse files
committed
Auto merge of #30796 - GuillaumeGomez:impl_box_error, r=alexcrichton
Fixes #30349
2 parents e3bcddb + f9f2981 commit 3c9442f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/libstd/error.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@ impl Error for string::ParseError {
189189
}
190190
}
191191

192+
#[stable(feature = "box_error", since = "1.7.0")]
193+
impl<T: Error> Error for Box<T> {
194+
fn description(&self) -> &str {
195+
Error::description(&**self)
196+
}
197+
198+
fn cause(&self) -> Option<&Error> {
199+
Error::cause(&**self)
200+
}
201+
}
202+
192203
// copied from any.rs
193204
impl Error + 'static {
194205
/// Returns true if the boxed type is the same as `T`

0 commit comments

Comments
 (0)