Skip to content

Commit d8a42c7

Browse files
authored
Rollup merge of rust-lang#107736 - tgross35:atomic-as-ptr, r=m-ou-se
Rename atomic 'as_mut_ptr' to 'as_ptr' to match Cell (ref rust-lang#66893) Originally discussed in rust-lang#66893 (comment) ~~This uses rust-lang#107706 as a base to avoid a merge conflict once that gets rolled up (so disregard const changes in the diff until it does)~~ all merged & rebased `@rustbot` label +T-libs-api r? m-ou-se
2 parents 4a36af4 + e79b3c2 commit d8a42c7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

library/core/src/sync/atomic.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -922,13 +922,13 @@ impl AtomicBool {
922922
///
923923
/// let mut atomic = AtomicBool::new(true);
924924
/// unsafe {
925-
/// my_atomic_op(atomic.as_mut_ptr());
925+
/// my_atomic_op(atomic.as_ptr());
926926
/// }
927927
/// # }
928928
/// ```
929929
#[inline]
930930
#[unstable(feature = "atomic_mut_ptr", reason = "recently added", issue = "66893")]
931-
pub const fn as_mut_ptr(&self) -> *mut bool {
931+
pub const fn as_ptr(&self) -> *mut bool {
932932
self.v.get().cast()
933933
}
934934

@@ -1814,12 +1814,12 @@ impl<T> AtomicPtr<T> {
18141814
///
18151815
/// // SAFETY: Safe as long as `my_atomic_op` is atomic.
18161816
/// unsafe {
1817-
/// my_atomic_op(atomic.as_mut_ptr());
1817+
/// my_atomic_op(atomic.as_ptr());
18181818
/// }
18191819
/// ```
18201820
#[inline]
18211821
#[unstable(feature = "atomic_mut_ptr", reason = "recently added", issue = "66893")]
1822-
pub const fn as_mut_ptr(&self) -> *mut *mut T {
1822+
pub const fn as_ptr(&self) -> *mut *mut T {
18231823
self.p.get()
18241824
}
18251825
}
@@ -2719,15 +2719,15 @@ macro_rules! atomic_int {
27192719
///
27202720
/// // SAFETY: Safe as long as `my_atomic_op` is atomic.
27212721
/// unsafe {
2722-
/// my_atomic_op(atomic.as_mut_ptr());
2722+
/// my_atomic_op(atomic.as_ptr());
27232723
/// }
27242724
/// # }
27252725
/// ```
27262726
#[inline]
27272727
#[unstable(feature = "atomic_mut_ptr",
27282728
reason = "recently added",
27292729
issue = "66893")]
2730-
pub const fn as_mut_ptr(&self) -> *mut $int_type {
2730+
pub const fn as_ptr(&self) -> *mut $int_type {
27312731
self.v.get()
27322732
}
27332733
}

0 commit comments

Comments
 (0)