Skip to content

Commit 6340607

Browse files
committed
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`
2 parents d8d3ab9 + 1a1a99c commit 6340607

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Diff for: library/core/src/cell.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
15801580
/// `&UnsafeCell<_>` reference); there is no magic whatsoever when dealing with _exclusive_
15811581
/// accesses (_e.g._, through an `&mut UnsafeCell<_>`): neither the cell nor the wrapped value
15821582
/// may be aliased for the duration of that `&mut` borrow.
1583-
/// This is showcased by the [`.get_mut()`] accessor, which is a non-`unsafe` getter that yields
1583+
/// This is showcased by the [`.get_mut()`] accessor, which is a _safe_ getter that yields
15841584
/// a `&mut T`.
15851585
///
15861586
/// [`.get_mut()`]: `UnsafeCell::get_mut`
@@ -1618,7 +1618,6 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
16181618
/// implies exclusive access to its `T`:
16191619
///
16201620
/// ```rust
1621-
/// #![feature(unsafe_cell_get_mut)]
16221621
/// #![forbid(unsafe_code)] // with exclusive accesses,
16231622
/// // `UnsafeCell` is a transparent no-op wrapper,
16241623
/// // so no need for `unsafe` here.
@@ -1722,7 +1721,6 @@ impl<T: ?Sized> UnsafeCell<T> {
17221721
/// # Examples
17231722
///
17241723
/// ```
1725-
/// #![feature(unsafe_cell_get_mut)]
17261724
/// use std::cell::UnsafeCell;
17271725
///
17281726
/// let mut c = UnsafeCell::new(5);
@@ -1731,7 +1729,7 @@ impl<T: ?Sized> UnsafeCell<T> {
17311729
/// assert_eq!(*c.get_mut(), 6);
17321730
/// ```
17331731
#[inline]
1734-
#[unstable(feature = "unsafe_cell_get_mut", issue = "76943")]
1732+
#[stable(feature = "unsafe_cell_get_mut", since = "1.50.0")]
17351733
pub fn get_mut(&mut self) -> &mut T {
17361734
&mut self.value
17371735
}

Diff for: library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@
325325
#![feature(try_reserve)]
326326
#![feature(unboxed_closures)]
327327
#![feature(unsafe_block_in_unsafe_fn)]
328-
#![feature(unsafe_cell_get_mut)]
329328
#![feature(unsafe_cell_raw_get)]
330329
#![feature(unwind_attributes)]
331330
#![feature(vec_into_raw_parts)]

0 commit comments

Comments
 (0)