Skip to content

Commit cc605c8

Browse files
committed
Remove {Cell,RefCell}::as_unsafe_cell
[unstable, deprecated since 1.12.0]
1 parent f0c5e8b commit cc605c8

File tree

3 files changed

+0
-51
lines changed

3 files changed

+0
-51
lines changed

src/doc/unstable-book/src/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
- [alloc_system](library-features/alloc-system.md)
102102
- [alloc](library-features/alloc.md)
103103
- [as_c_str](library-features/as-c-str.md)
104-
- [as_unsafe_cell](library-features/as-unsafe-cell.md)
105104
- [ascii_ctype](library-features/ascii-ctype.md)
106105
- [binary_heap_peek_mut_pop](library-features/binary-heap-peek-mut-pop.md)
107106
- [borrow_state](library-features/borrow-state.md)

src/doc/unstable-book/src/library-features/as-unsafe-cell.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/libcore/cell.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)