@@ -310,26 +310,6 @@ impl<T> Cell<T> {
310310 }
311311 }
312312
313- /// Returns a reference to the underlying `UnsafeCell`.
314- ///
315- /// # Examples
316- ///
317- /// ```
318- /// #![feature(as_unsafe_cell)]
319- ///
320- /// use std::cell::Cell;
321- ///
322- /// let c = Cell::new(5);
323- ///
324- /// let uc = c.as_unsafe_cell();
325- /// ```
326- #[ inline]
327- #[ unstable( feature = "as_unsafe_cell" , issue = "27708" ) ]
328- #[ rustc_deprecated( since = "1.12.0" , reason = "renamed to as_ptr" ) ]
329- pub fn as_unsafe_cell ( & self ) -> & UnsafeCell < T > {
330- & self . value
331- }
332-
333313 /// Returns a raw pointer to the underlying data in this cell.
334314 ///
335315 /// # Examples
@@ -769,29 +749,6 @@ impl<T: ?Sized> RefCell<T> {
769749 }
770750 }
771751
772- /// Returns a reference to the underlying `UnsafeCell`.
773- ///
774- /// This can be used to circumvent `RefCell`'s safety checks.
775- ///
776- /// This function is `unsafe` because `UnsafeCell`'s field is public.
777- ///
778- /// # Examples
779- ///
780- /// ```
781- /// #![feature(as_unsafe_cell)]
782- ///
783- /// use std::cell::RefCell;
784- ///
785- /// let c = RefCell::new(5);
786- /// let c = unsafe { c.as_unsafe_cell() };
787- /// ```
788- #[ inline]
789- #[ unstable( feature = "as_unsafe_cell" , issue = "27708" ) ]
790- #[ rustc_deprecated( since = "1.12.0" , reason = "renamed to as_ptr" ) ]
791- pub unsafe fn as_unsafe_cell ( & self ) -> & UnsafeCell < T > {
792- & self . value
793- }
794-
795752 /// Returns a raw pointer to the underlying data in this cell.
796753 ///
797754 /// # Examples
0 commit comments