Skip to content

Commit

Permalink
Remove {Cell,RefCell}::as_unsafe_cell
Browse files Browse the repository at this point in the history
[unstable, deprecated since 1.12.0]
  • Loading branch information
cuviper committed Apr 21, 2017
1 parent f0c5e8b commit cc605c8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 51 deletions.
1 change: 0 additions & 1 deletion src/doc/unstable-book/src/SUMMARY.md
Expand Up @@ -101,7 +101,6 @@
- [alloc_system](library-features/alloc-system.md)
- [alloc](library-features/alloc.md)
- [as_c_str](library-features/as-c-str.md)
- [as_unsafe_cell](library-features/as-unsafe-cell.md)
- [ascii_ctype](library-features/ascii-ctype.md)
- [binary_heap_peek_mut_pop](library-features/binary-heap-peek-mut-pop.md)
- [borrow_state](library-features/borrow-state.md)
Expand Down
7 changes: 0 additions & 7 deletions src/doc/unstable-book/src/library-features/as-unsafe-cell.md

This file was deleted.

43 changes: 0 additions & 43 deletions src/libcore/cell.rs
Expand Up @@ -310,26 +310,6 @@ impl<T> Cell<T> {
}
}

/// Returns a reference to the underlying `UnsafeCell`.
///
/// # Examples
///
/// ```
/// #![feature(as_unsafe_cell)]
///
/// use std::cell::Cell;
///
/// let c = Cell::new(5);
///
/// let uc = c.as_unsafe_cell();
/// ```
#[inline]
#[unstable(feature = "as_unsafe_cell", issue = "27708")]
#[rustc_deprecated(since = "1.12.0", reason = "renamed to as_ptr")]
pub fn as_unsafe_cell(&self) -> &UnsafeCell<T> {
&self.value
}

/// Returns a raw pointer to the underlying data in this cell.
///
/// # Examples
Expand Down Expand Up @@ -769,29 +749,6 @@ impl<T: ?Sized> RefCell<T> {
}
}

/// Returns a reference to the underlying `UnsafeCell`.
///
/// This can be used to circumvent `RefCell`'s safety checks.
///
/// This function is `unsafe` because `UnsafeCell`'s field is public.
///
/// # Examples
///
/// ```
/// #![feature(as_unsafe_cell)]
///
/// use std::cell::RefCell;
///
/// let c = RefCell::new(5);
/// let c = unsafe { c.as_unsafe_cell() };
/// ```
#[inline]
#[unstable(feature = "as_unsafe_cell", issue = "27708")]
#[rustc_deprecated(since = "1.12.0", reason = "renamed to as_ptr")]
pub unsafe fn as_unsafe_cell(&self) -> &UnsafeCell<T> {
&self.value
}

/// Returns a raw pointer to the underlying data in this cell.
///
/// # Examples
Expand Down

0 comments on commit cc605c8

Please sign in to comment.