Skip to content

Commit

Permalink
libstd: implement Error::source for io::Error
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Mar 6, 2019
1 parent f22dca0 commit 0d39797
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libstd/io/error.rs
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 0d39797

Please sign in to comment.