Skip to content

serde_amqp::read::IoReader unit test fails after rust is updated to 1.80 #270

@minghuaw

Description

@minghuaw

The two unit tests that are failing are

  1. read::ioread::tests::test_incomplete_read_const_bytes_after_peek
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions