Remove unsafe qualifier from RefCell::as_unsafe_cell

This method is no longer unsafe because the field of `UnsafeCell` is no
longer public.
This commit is contained in:
Tobias Bucher 2016-03-28 15:29:15 +02:00
parent f738dc1fe4
commit 4ddbd6b5b0

View File

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