Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Conversation

programmerjake
Copy link
Member

@programmerjake programmerjake commented Jul 5, 2022

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

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

@rustbot rustbot 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
Collaborator

rustbot commented Jul 5, 2022

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
Collaborator

r? @joshtriplett

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

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

5225225 commented Jul 5, 2022

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 programmerjake force-pushed the add-readbuf-buf-accessor branch from 020e8cb to 0d5bd5b Compare July 5, 2022 23:08
@programmerjake
Copy link
Member Author

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
Member Author

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

@rustbot rustbot added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 8, 2022
@JohnCSimon JohnCSimon 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
@JohnCSimon JohnCSimon 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
Copy link
Contributor

pitaj commented Jan 29, 2023

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

@rustbot rustbot 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
Member Author

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-DPC Dylan-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
@dtolnay dtolnay changed the title add ReadBuf::buf* accessor functions for getting the original buffer add BorrowedBuf::buf* accessor functions for getting the original buffer Sep 17, 2023
@dtolnay dtolnay assigned dtolnay and unassigned joshtriplett Sep 17, 2023
Copy link
Member

@dtolnay dtolnay left a comment

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?

@dtolnay dtolnay 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
Copy link
Contributor

bors commented Nov 9, 2023

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

Copy link
Member

@dtolnay dtolnay left a comment

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!

@dtolnay dtolnay closed this Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants