The two unit tests that are failing are
read::ioread::tests::test_incomplete_read_const_bytes_after_peek
read::ioread::tests::test_incomplete_read_const_bytes_without_peek
The cause of this is introduced in a change of behaviour in std::io::Cursor (rust-lang/rust#125123) where the cursor would drain (ie. move pos to the end) even if read_exact or read_buf_exact fails.
This is a more general problem than just Cursor as we were relying on unspecified behaviour. There's a warning for the error case in std::io::Read::read_exact
If this function returns an error, it is unspecified how many bytes it has read, but it will never read more than would be necessary to completely fill the buffer.
The two unit tests that are failing are
read::ioread::tests::test_incomplete_read_const_bytes_after_peekread::ioread::tests::test_incomplete_read_const_bytes_without_peekThe cause of this is introduced in a change of behaviour in
std::io::Cursor(rust-lang/rust#125123) where the cursor would drain (ie. moveposto the end) even ifread_exactorread_buf_exactfails.This is a more general problem than just
Cursoras we were relying on unspecified behaviour. There's a warning for the error case instd::io::Read::read_exact