rust
rust copied to clipboard
Remove `ptr` from `AtomicPtr::fetch_{add,sub}` method names
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 https://github.com/rust-lang/rust/issues/99108#issuecomment-1272332432
r? @thomcc
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
@rustbot label +T-libs-api -T-libs
I agree this naming as-is is not ideal, but it was done deliberately to avoid the footgun described here: https://github.com/rust-lang/rust/pull/96935#issuecomment-1124317265. That is, the initial version of the PR used the names you describe and was changed to avoid confusion.
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>()
.
Do you want to open an ACP about this as a place to hold the bikeshed coloring discussion?
Yeah, I think it's a good idea
Opened ACP: https://github.com/rust-lang/libs-team/issues/126