Skip to content

Commit

Permalink
Rollup merge of rust-lang#58963 - seanmonstar:patch-3, r=cramertj
Browse files Browse the repository at this point in the history
libstd: implement Error::source for io::Error
  • Loading branch information
pietroalbini authored Mar 8, 2019
2 parents 54a5073 + 0d39797 commit 378a011
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libstd/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 378a011

Please sign in to comment.