]> git.lizzy.rs Git - rust.git/commitdiff
Remove {Cell,RefCell}::as_unsafe_cell
authorJosh Stone <jistone@redhat.com>
Thu, 20 Apr 2017 21:06:18 +0000 (14:06 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 21 Apr 2017 04:16:31 +0000 (21:16 -0700)
[unstable, deprecated since 1.12.0]

src/doc/unstable-book/src/SUMMARY.md
src/doc/unstable-book/src/library-features/as-unsafe-cell.md [deleted file]
src/libcore/cell.rs

index 0362ed6ba9d39623eafdbeff60809dc1544fb5d2..2a932e342f6a702966d1c66ebaa0e0b8b54ec96b 100644 (file)
     - [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)
diff --git a/src/doc/unstable-book/src/library-features/as-unsafe-cell.md b/src/doc/unstable-book/src/library-features/as-unsafe-cell.md
deleted file mode 100644 (file)
index 79d7a7c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# `as_unsafe_cell`
-
-The tracking issue for this feature is: [#27708]
-
-[#27708]: https://github.com/rust-lang/rust/issues/27708
-
-------------------------
index 0186d9727828d0420a0d048d0bcd8037bf470901..a5dda5625bd3a8c5c6a7eeffafe0dc7e4cc2e395 100644 (file)
@@ -310,26 +310,6 @@ pub const fn new(value: 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
@@ -769,29 +749,6 @@ pub fn try_borrow_mut(&self) -> Result<RefMut<T>, BorrowMutError> {
         }
     }
 
-    /// 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