Rollup merge of #58963 - seanmonstar:patch-3, r=cramertj

libstd: implement Error::source for io::Error
This commit is contained in:
Pietro Albini 2019-03-08 09:42:10 +01:00 committed by GitHub
commit 378a0118f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -556,6 +556,14 @@ impl error::Error for Error {
Repr::Custom(ref c) => c.error.cause(),
}
}
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
match self.repr {
Repr::Os(..) => None,
Repr::Simple(..) => None,
Repr::Custom(ref c) => c.error.source(),
}
}
}
fn _assert_error_is_sync_send() {