Auto merge of #32550 - tbu-:pr_ref_cell_as_unsafe_cell, r=alexcrichton

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:
bors 2016-03-31 17:52:25 -07:00
commit a2f0cc6b0c
1 changed files with 2 additions and 6 deletions

View File

@ -216,10 +216,6 @@ impl<T:Copy> Cell<T> {
/// Returns a reference to the underlying `UnsafeCell`.
///
/// # Safety
///
/// This function is `unsafe` because `UnsafeCell`'s field is public.
///
/// # Examples
///
/// ```
@ -229,11 +225,11 @@ impl<T:Copy> Cell<T> {
///
/// 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<T> {
pub fn as_unsafe_cell(&self) -> &UnsafeCell<T> {
&self.value
}
}