mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rollup merge of #58963 - seanmonstar:patch-3, r=cramertj
libstd: implement Error::source for io::Error
This commit is contained in:
commit
378a0118f3
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user