Skip to content

Commit 861698a

Browse files
committed
make things ugly
1 parent 5b5ae01 commit 861698a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libcore/cell.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1572,18 +1572,18 @@ impl<T: ?Sized> UnsafeCell<T> {
15721572
/// use std::mem::MaybeUninit;
15731573
///
15741574
/// let m = MaybeUninit::<UnsafeCell<i32>>::uninit();
1575-
/// unsafe { m.as_ptr().raw_get().write(5); }
1575+
/// unsafe { UnsafeCell::raw_get(m.as_ptr()).write(5); }
15761576
/// let uc = unsafe { m.assume_init() };
15771577
///
15781578
/// assert_eq!(uc.into_inner(), 5);
15791579
/// ```
15801580
#[inline]
15811581
#[unstable(feature = "unsafe_cell_raw_get", issue = "66358")]
1582-
pub const fn raw_get(self: *const Self) -> *mut T {
1582+
pub const fn raw_get(this: *const Self) -> *mut T {
15831583
// We can just cast the pointer from `UnsafeCell<T>` to `T` because of
15841584
// #[repr(transparent)]. This exploits libstd's special status, there is
15851585
// no guarantee for user code that this will work in future versions of the compiler!
1586-
self as *const T as *mut T
1586+
this as *const T as *mut T
15871587
}
15881588
}
15891589

0 commit comments

Comments
 (0)