Skip to content

refactor recvmmsg lifetimes - #2601

Open
pacak wants to merge 3 commits into
nix-rust:masterfrom
pacak:recvmmsg2
Open

refactor recvmmsg lifetimes#2601
pacak wants to merge 3 commits into
nix-rust:masterfrom
pacak:recvmmsg2

Conversation

@pacak

@pacak pacak commented Feb 10, 2025

Copy link
Copy Markdown
Contributor

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

@pacak
pacak force-pushed the recvmmsg2 branch 2 times, most recently from f18400e to 52c049f Compare February 10, 2025 23:56
@pacak

pacak commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Clipy/rustdoc looks very unhappy. Anyway, we've been using this in production since I implemented it. Renamed lifetimes a bit and replaced 'data with 'iter- to cover all the references it needs to hold. What needs to be done to get this merged?

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