Skip to content

Commit 874aee7

Browse files
committed
Stabilize UnsafeCell::from_mut
1 parent 267cf8d commit 874aee7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/cell.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,8 @@ impl<T: ?Sized> UnsafeCell<T> {
21252125
/// assert_eq!(*uc.get_mut(), 41);
21262126
/// ```
21272127
#[inline(always)]
2128-
#[unstable(feature = "unsafe_cell_from_mut", issue = "111645")]
2128+
#[stable(feature = "unsafe_cell_from_mut", since = "CURRENT_RUSTC_VERSION")]
2129+
#[rustc_const_stable(feature = "unsafe_cell_from_mut", since = "CURRENT_RUSTC_VERSION")]
21292130
pub const fn from_mut(value: &mut T) -> &mut UnsafeCell<T> {
21302131
// SAFETY: `UnsafeCell<T>` has the same memory layout as `T` due to #[repr(transparent)].
21312132
unsafe { &mut *(value as *mut T as *mut UnsafeCell<T>) }

0 commit comments

Comments
 (0)