Skip to content

Commit

Permalink
Remove unsafe qualifier from RefCell::as_unsafe_cell
Browse files Browse the repository at this point in the history
This method is no longer unsafe because the field of `UnsafeCell` is no
longer public.
  • Loading branch information
tbu- committed Mar 28, 2016
1 parent f738dc1 commit 4ddbd6b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/libcore/cell.rs
Expand Up @@ -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
///
/// ```
Expand All @@ -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
}
}
Expand Down

0 comments on commit 4ddbd6b

Please sign in to comment.