Skip to content

add BorrowedBuf::buf* accessor functions for getting the original buffer - #98962

Closed
programmerjake wants to merge 1 commit into
rust-lang:masterfrom
programmerjake:add-readbuf-buf-accessor
Closed

add BorrowedBuf::buf* accessor functions for getting the original buffer#98962
programmerjake wants to merge 1 commit into
rust-lang:masterfrom
programmerjake:add-readbuf-buf-accessor

Conversation

@programmerjake

@programmerjakeprogrammerjake commented Jul 5, 2022

Copy link
Copy Markdown
Member

I noticed these functions were missing so I had to use an annoying workaround...

ACP: rust-lang/libs-team#65 [accepted]

@rustbotrustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jul 5, 2022
@rustbot

Copy link
Copy Markdown
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @joshtriplett

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 5, 2022
@ghost

ghost commented Jul 5, 2022

Copy link
Copy Markdown

buf_mut looks unsound, as you can deinitialize bytes that are assume to be init.

buf and into_buf would be fine, as would buf_mut but being unsafe (or resetting the initialized part to 0).

@programmerjake
programmerjakeforce-pushed the add-readbuf-buf-accessor branch from 020e8cb to 0d5bd5bCompareJuly 5, 2022 23:08
@programmerjake

Copy link
Copy Markdown
MemberAuthor

buf_mut looks unsound, as you can deinitialize bytes that are assume to be init.

nice catch, i changed buf_mut to be unsafe

@programmerjake

Copy link
Copy Markdown
MemberAuthor

@rustbot label +T-libs-api -T-libs

@rustbotrustbot added T-libs-api [DEPRECATED; DO NOT USE] and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 8, 2022
@JohnCSimonJohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2022
@JohnCSimonJohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 8, 2022
@pitaj

pitaj commented Jan 29, 2023

Copy link
Copy Markdown
Contributor

Hi, this is an API change and so needs to go through the ACP process, as described by the bot. Please open one if you haven't already, and link it here.

@rustbot label -S-waiting-on-review +S-waiting-on-ACP

@rustbotrustbot added S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2023
@programmerjake

Copy link
Copy Markdown
MemberAuthor

Hi, this is an API change and so needs to go through the ACP process, as described by the bot. Please open one if you haven't already, and link it here.

rust-lang/libs-team#65

@Dylan-DPCDylan-DPC added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. labels Jul 22, 2023
@dtolnaydtolnay changed the title add ReadBuf::buf* accessor functions for getting the original bufferadd BorrowedBuf::buf* accessor functions for getting the original bufferSep 17, 2023
@dtolnaydtolnay assigned dtolnay and unassigned joshtriplettSep 17, 2023

@dtolnaydtolnay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you look into rebasing this past #97015?

Would these methods be needed only on BorrowedBuf, or also on BorrowedCursor?

@dtolnaydtolnay added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 28, 2023
@bors

bors commented Nov 9, 2023

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #117736) made this pull request unmergeable. Please resolve the merge conflicts.

@dtolnaydtolnay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's pick this up in rust-lang/libs-team#65, or a new ACP, if there is still a use case for this.

Thanks anyway for the PR!

@dtolnaydtolnay closed this Jan 21, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.T-libs-api[DEPRECATED; DO NOT USE]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@programmerjake@rustbot@rust-highfive@pitaj@bors@dtolnay@joshtriplett@JohnCSimon@Dylan-DPC