about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-18 11:39:26 +0000
committerbors <bors@rust-lang.org>2020-12-18 11:39:26 +0000
commit6340607acaab10eed3cf11ef7ad3564db58ec981 (patch)
tree753e3fd666d877d33ee5360597838d548c317f89
parentd8d3ab96aa94423f1bdfbb605098a506ab5edc7e (diff)
parent1a1a99ccb7be53c0a14d52ef825caf0fb9fa01a5 (diff)
downloadrust-6340607acaab10eed3cf11ef7ad3564db58ec981.tar.gz
rust-6340607acaab10eed3cf11ef7ad3564db58ec981.zip
Auto merge of #79485 - EllenNyan:stabilize_unsafe_cell_get_mut, r=m-ou-se
Stabilize `unsafe_cell_get_mut`

Tracking issue: #76943

r? `@m-ou-se`
-rw-r--r--library/core/src/cell.rs6
-rw-r--r--library/std/src/lib.rs1
2 files changed, 2 insertions, 5 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index c7a76d33a66..c5ab7a39ff0 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -1580,7 +1580,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
 /// `&UnsafeCell<_>` reference); there is no magic whatsoever when dealing with _exclusive_
 /// accesses (_e.g._, through an `&mut UnsafeCell<_>`): neither the cell nor the wrapped value
 /// may be aliased for the duration of that `&mut` borrow.
-/// This is showcased by the [`.get_mut()`] accessor, which is a non-`unsafe` getter that yields
+/// This is showcased by the [`.get_mut()`] accessor, which is a _safe_ getter that yields
 /// a `&mut T`.
 ///
 /// [`.get_mut()`]: `UnsafeCell::get_mut`
@@ -1618,7 +1618,6 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
 /// implies exclusive access to its `T`:
 ///
 /// ```rust
-/// #![feature(unsafe_cell_get_mut)]
 /// #![forbid(unsafe_code)] // with exclusive accesses,
 ///                         // `UnsafeCell` is a transparent no-op wrapper,
 ///                         // so no need for `unsafe` here.
@@ -1722,7 +1721,6 @@ impl<T: ?Sized> UnsafeCell<T> {
     /// # Examples
     ///
     /// ```
-    /// #![feature(unsafe_cell_get_mut)]
     /// use std::cell::UnsafeCell;
     ///
     /// let mut c = UnsafeCell::new(5);
@@ -1731,7 +1729,7 @@ impl<T: ?Sized> UnsafeCell<T> {
     /// assert_eq!(*c.get_mut(), 6);
     /// ```
     #[inline]
-    #[unstable(feature = "unsafe_cell_get_mut", issue = "76943")]
+    #[stable(feature = "unsafe_cell_get_mut", since = "1.50.0")]
     pub fn get_mut(&mut self) -> &mut T {
         &mut self.value
     }
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index fc48997f1bb..39b0ca63301 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -325,7 +325,6 @@
 #![feature(try_reserve)]
 #![feature(unboxed_closures)]
 #![feature(unsafe_block_in_unsafe_fn)]
-#![feature(unsafe_cell_get_mut)]
 #![feature(unsafe_cell_raw_get)]
 #![feature(unwind_attributes)]
 #![feature(vec_into_raw_parts)]