From 861698a493fc547254e61dc23a43dfb0683df91a Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 13 Nov 2019 09:31:08 +0100 Subject: [PATCH] make things ugly --- src/libcore/cell.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 7b7be8f3d2ff..03f32e726187 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -1572,18 +1572,18 @@ impl UnsafeCell { /// use std::mem::MaybeUninit; /// /// let m = MaybeUninit::>::uninit(); - /// unsafe { m.as_ptr().raw_get().write(5); } + /// unsafe { UnsafeCell::raw_get(m.as_ptr()).write(5); } /// let uc = unsafe { m.assume_init() }; /// /// assert_eq!(uc.into_inner(), 5); /// ``` #[inline] #[unstable(feature = "unsafe_cell_raw_get", issue = "66358")] - pub const fn raw_get(self: *const Self) -> *mut T { + pub const fn raw_get(this: *const Self) -> *mut T { // We can just cast the pointer from `UnsafeCell` to `T` because of // #[repr(transparent)]. This exploits libstd's special status, there is // no guarantee for user code that this will work in future versions of the compiler! - self as *const T as *mut T + this as *const T as *mut T } }