about summary refs log tree commit diff
diff options
context:
space:
mode:
authorinquisitivecrystal <22333129+inquisitivecrystal@users.noreply.github.com>2021-08-31 14:44:13 -0700
committerinquisitivecrystal <22333129+inquisitivecrystal@users.noreply.github.com>2021-08-31 14:44:13 -0700
commit753dac16abd16411e1833b35ba82cabac6997cec (patch)
treeb24bf27a97d0a7b9559f16e35a6f11106e484725
parent0a84708edca7c275cb99ad080317fbc7637516d8 (diff)
downloadrust-753dac16abd16411e1833b35ba82cabac6997cec.tar.gz
rust-753dac16abd16411e1833b35ba82cabac6997cec.zip
Stabilize `UnsafeCell::raw_get()`
-rw-r--r--library/core/src/cell.rs5
-rw-r--r--library/std/src/lib.rs1
2 files changed, 2 insertions, 4 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index 85b43f48847..2adf6a549e6 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -1921,7 +1921,7 @@ impl<T: ?Sized> UnsafeCell<T> {
     }
 
     /// Gets a mutable pointer to the wrapped value.
-    /// The difference to [`get`] is that this function accepts a raw pointer,
+    /// The difference from [`get`] is that this function accepts a raw pointer,
     /// which is useful to avoid the creation of temporary references.
     ///
     /// The result can be cast to a pointer of any kind.
@@ -1937,7 +1937,6 @@ impl<T: ?Sized> UnsafeCell<T> {
     /// calling `get` would require creating a reference to uninitialized data:
     ///
     /// ```
-    /// #![feature(unsafe_cell_raw_get)]
     /// use std::cell::UnsafeCell;
     /// use std::mem::MaybeUninit;
     ///
@@ -1948,7 +1947,7 @@ impl<T: ?Sized> UnsafeCell<T> {
     /// assert_eq!(uc.into_inner(), 5);
     /// ```
     #[inline(always)]
-    #[unstable(feature = "unsafe_cell_raw_get", issue = "66358")]
+    #[stable(feature = "unsafe_cell_raw_get", since = "1.56.0")]
     pub const fn raw_get(this: *const Self) -> *mut T {
         // We can just cast the pointer from `UnsafeCell<T>` to `T` because of
         // #[repr(transparent)]. This exploits libstd's special status, there is
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 028a066b5a1..43c7ec5fad3 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -331,7 +331,6 @@
 #![feature(try_reserve)]
 #![feature(try_reserve_kind)]
 #![feature(unboxed_closures)]
-#![feature(unsafe_cell_raw_get)]
 #![feature(unwrap_infallible)]
 #![feature(vec_into_raw_parts)]
 #![feature(vec_spare_capacity)]