diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index 7140218fa9101..ef2a5dd570f73 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -1733,8 +1733,7 @@ impl UnsafeCell { #[inline] #[unstable(feature = "unsafe_cell_get_mut", issue = "76943")] pub fn get_mut(&mut self) -> &mut T { - // SAFETY: (outer) `&mut` guarantees unique access. - unsafe { &mut *self.get() } + &mut self.value } /// Gets a mutable pointer to the wrapped value.