Skip to content

Conversation

@a1phyr
Copy link
Contributor

@a1phyr a1phyr commented Dec 18, 2025

This PR changes uninitialized bytes tracking in BorrowedBuf from being byte-wise to being buffer-wise.

I've put all the API around init a new unstable feature borrowed_buf_init, to split the part that needs it and the part that doesn't. It will avoids accidental stabilization of this part.

I'm not really convinced of the rename of advance_unchecked to advance, but I did it anyway. The old advance was kept as advance_checked.

Alternative of #148937

Cc #78485 #117693
Cc @joshtriplett

r? @Amanieu

@rustbot rustbot added O-SGX Target: SGX O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 18, 2025
@rust-log-analyzer

This comment has been minimized.

@joshtriplett
Copy link
Member

joshtriplett commented Dec 18, 2025

The old advance was kept as advance_checked.

As far as I can tell, if we keep that API in any form, that commits us to always having initialization tracking. I don't think there's any way to have an advance_checked operation if we eventually drop initialization tracking entirely.

EDIT: That's fully addressed by keeping advance_checked under the separate borrowed_buf_init, which I'm hoping we never stabilize, and eventually remove.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-SGX Target: SGX O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants