diff options
| author | Ralf Jung <post@ralfj.de> | 2019-11-13 09:31:08 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-11-13 09:31:08 +0100 |
| commit | 861698a493fc547254e61dc23a43dfb0683df91a (patch) | |
| tree | 456990164645589c8c73440ce60e1b5be45acadd | |
| parent | 5b5ae01340fdbb31f56453655472b783e5719eb9 (diff) | |
| download | rust-861698a493fc547254e61dc23a43dfb0683df91a.tar.gz rust-861698a493fc547254e61dc23a43dfb0683df91a.zip | |
make things ugly
| -rw-r--r-- | src/libcore/cell.rs | 6 |
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 } } |
