about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-11-13 09:31:08 +0100
committerRalf Jung <post@ralfj.de>2019-11-13 09:31:08 +0100
commit861698a493fc547254e61dc23a43dfb0683df91a (patch)
tree456990164645589c8c73440ce60e1b5be45acadd
parent5b5ae01340fdbb31f56453655472b783e5719eb9 (diff)
downloadrust-861698a493fc547254e61dc23a43dfb0683df91a.tar.gz
rust-861698a493fc547254e61dc23a43dfb0683df91a.zip
make things ugly
-rw-r--r--src/libcore/cell.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index 7b7be8f3d2f..03f32e72618 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -1572,18 +1572,18 @@ impl<T: ?Sized> UnsafeCell<T> {
     /// use std::mem::MaybeUninit;
     ///
     /// let m = MaybeUninit::<UnsafeCell<i32>>::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<T>` 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
     }
 }