diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index fdd2e3a1784..4a9a1485063 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -216,10 +216,6 @@ impl Cell { /// Returns a reference to the underlying `UnsafeCell`. /// - /// # Safety - /// - /// This function is `unsafe` because `UnsafeCell`'s field is public. - /// /// # Examples /// /// ``` @@ -229,11 +225,11 @@ impl Cell { /// /// let c = Cell::new(5); /// - /// let uc = unsafe { c.as_unsafe_cell() }; + /// let uc = c.as_unsafe_cell(); /// ``` #[inline] #[unstable(feature = "as_unsafe_cell", issue = "27708")] - pub unsafe fn as_unsafe_cell(&self) -> &UnsafeCell { + pub fn as_unsafe_cell(&self) -> &UnsafeCell { &self.value } }