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

Remove ptr from AtomicPtr::fetch_{add,sub} method names #102970

Closed

Conversation

WaffleLapkin
Copy link
Member

Rename AtomicPtr::{fetch_ptr_add => fetch_add, fetch_ptr_sub => fetch_sub}.

Reasoning TL;DR: new naming is consistent with other Atomic* and pointer methods, see #99108 (comment)

r? @thomcc

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 12, 2022
@rustbot
Copy link
Collaborator

rustbot commented Oct 12, 2022

The Miri subtree was changed

cc @rust-lang/miri

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 rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 12, 2022
@WaffleLapkin
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 Oct 12, 2022
@thomcc
Copy link
Member

thomcc commented Oct 12, 2022

I agree this naming as-is is not ideal, but it was done deliberately to avoid the footgun described here: #96935 (comment). That is, the initial version of the PR used the names you describe and was changed to avoid confusion.

@thomcc
Copy link
Member

thomcc commented Oct 12, 2022

That said I am in favor of changing the name. I think fetch_ptr_add implies it's in units of size_of::<*const T>() rather than size_of::<T>().

@thomcc
Copy link
Member

thomcc commented Oct 15, 2022

Do you want to open an ACP about this as a place to hold the bikeshed coloring discussion?

@WaffleLapkin
Copy link
Member Author

Yeah, I think it's a good idea

@WaffleLapkin
Copy link
Member Author

Opened ACP: rust-lang/libs-team#126

@thomcc thomcc added the S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. label Nov 20, 2022
@anden3 anden3 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 May 14, 2023
@Dylan-DPC Dylan-DPC removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 15, 2023
@WaffleLapkin
Copy link
Member Author

ACP was declined

@WaffleLapkin WaffleLapkin deleted the no_ptr_in_fetch_add_sub branch May 16, 2023 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. 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.

None yet

6 participants