Check IO errors in test using `raw_os_error()` instead of `kind()` 2021-07-fix-beta
authorMatt Corallo <git@bluematt.me>
Mon, 2 Aug 2021 15:04:40 +0000 (15:04 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 2 Aug 2021 18:50:00 +0000 (18:50 +0000)
commit84909447e9efb9737f6d7bfaecd6f0d863464625
tree0e9b45ff51f9bd629970f717c38e39d68ab07893
parent0fa18658cdd7d1510f21fd81d29aec233a55c0f8
Check IO errors in test using `raw_os_error()` instead of `kind()`

std::io::ErrorKind is a `#[non_exhaustive]` enum as more specific
error types are to be added in the future. It was unclear in the
docs until very recently, however, that this is to be done by
re-defining `ErrorKind::Other` errors to new enum variants. Thus,
our tests which check explicitly for `ErrorKind::Other` as a
result of trying to access a directory as a file were incorrect.
Sadly, these generated no meaningful feedback from rustc at all,
except that they're suddenly failing in rustc beta!

After some back-and-forth, it seems rustc is moving forward
breaking existing code in future versions, so we move to the
"correct" check here, which is to check the raw IO error.

See rust-lang/rust#86442 and rust-lang/rust#85746 for more info.
lightning-block-sync/src/http.rs
lightning-persister/src/util.rs