nix
nix copied to clipboard
refactor recvmmsg lifetimes
trafficstars
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:
- [x] I have read
CONTRIBUTING.md - [x] I have written necessary tests and rustdoc comments
- [ ] A change log has been added if this PR modifies nix's API