From 4ddbd6b5b0f356eae0ec4ba5fcea277885da7528 Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Mon, 28 Mar 2016 15:29:15 +0200 Subject: [PATCH] Remove `unsafe` qualifier from `RefCell::as_unsafe_cell` This method is no longer unsafe because the field of `UnsafeCell` is no longer public. --- src/libcore/cell.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index fdd2e3a178499..4a9a148506343 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 } }