Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor recvmmsg lifetimes #2601

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

refactor recvmmsg lifetimes #2601

wants to merge 2 commits into from

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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant