Skip to content

Commit

Permalink
Rename atomic 'as_mut_ptr' to 'as_ptr' to match Cell (ref rust-lang#6…
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Feb 7, 2023
1 parent bd39bbb commit e79b3c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions library/core/src/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,13 +922,13 @@ impl AtomicBool {
///
/// let mut atomic = AtomicBool::new(true);
/// unsafe {
/// my_atomic_op(atomic.as_mut_ptr());
/// my_atomic_op(atomic.as_ptr());
/// }
/// # }
/// ```
#[inline]
#[unstable(feature = "atomic_mut_ptr", reason = "recently added", issue = "66893")]
pub const fn as_mut_ptr(&self) -> *mut bool {
pub const fn as_ptr(&self) -> *mut bool {
self.v.get().cast()
}

Expand Down Expand Up @@ -1814,12 +1814,12 @@ impl<T> AtomicPtr<T> {
///
/// // SAFETY: Safe as long as `my_atomic_op` is atomic.
/// unsafe {
/// my_atomic_op(atomic.as_mut_ptr());
/// my_atomic_op(atomic.as_ptr());
/// }
/// ```
#[inline]
#[unstable(feature = "atomic_mut_ptr", reason = "recently added", issue = "66893")]
pub const fn as_mut_ptr(&self) -> *mut *mut T {
pub const fn as_ptr(&self) -> *mut *mut T {
self.p.get()
}
}
Expand Down Expand Up @@ -2719,15 +2719,15 @@ macro_rules! atomic_int {
///
/// // SAFETY: Safe as long as `my_atomic_op` is atomic.
/// unsafe {
/// my_atomic_op(atomic.as_mut_ptr());
/// my_atomic_op(atomic.as_ptr());
/// }
/// # }
/// ```
#[inline]
#[unstable(feature = "atomic_mut_ptr",
reason = "recently added",
issue = "66893")]
pub const fn as_mut_ptr(&self) -> *mut $int_type {
pub const fn as_ptr(&self) -> *mut $int_type {
self.v.get()
}
}
Expand Down

0 comments on commit e79b3c2

Please sign in to comment.