Skip to content

Conversation

pacak
Copy link
Contributor

@pacak pacak commented Feb 10, 2025

What does this PR do

Currently recvmmsg uses a single lifetime to represent several different things:

  • preallocated MultiHdr
  • separately allocated IoSliceMut
  • iterator used to give access to all the IoSliceMut

While correct this makes it impossible to reuse preallocated headers in a loop - modified test fails to compile without this change, but compiles and runs as expected after.

As for the actual reason - I suspect this is a bug in the borrow checker, at least this RUSTFLAGS=-Zpolonius cargo +nightly check find no problems with modified test without requiring changes to recvmmsg.

Hmm... And there's an unrelated formatting only commit - current formatting is wrong, but ignored by CI.

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

into separate lifetimes for 'data, headers ('hdr) and related iterator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant