Skip to content

Commit 753dac1

Browse files
Stabilize UnsafeCell::raw_get()
1 parent 0a84708 commit 753dac1

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

library/core/src/cell.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,7 @@ impl<T: ?Sized> UnsafeCell<T> {
19211921
}
19221922

19231923
/// Gets a mutable pointer to the wrapped value.
1924-
/// The difference to [`get`] is that this function accepts a raw pointer,
1924+
/// The difference from [`get`] is that this function accepts a raw pointer,
19251925
/// which is useful to avoid the creation of temporary references.
19261926
///
19271927
/// The result can be cast to a pointer of any kind.
@@ -1937,7 +1937,6 @@ impl<T: ?Sized> UnsafeCell<T> {
19371937
/// calling `get` would require creating a reference to uninitialized data:
19381938
///
19391939
/// ```
1940-
/// #![feature(unsafe_cell_raw_get)]
19411940
/// use std::cell::UnsafeCell;
19421941
/// use std::mem::MaybeUninit;
19431942
///
@@ -1948,7 +1947,7 @@ impl<T: ?Sized> UnsafeCell<T> {
19481947
/// assert_eq!(uc.into_inner(), 5);
19491948
/// ```
19501949
#[inline(always)]
1951-
#[unstable(feature = "unsafe_cell_raw_get", issue = "66358")]
1950+
#[stable(feature = "unsafe_cell_raw_get", since = "1.56.0")]
19521951
pub const fn raw_get(this: *const Self) -> *mut T {
19531952
// We can just cast the pointer from `UnsafeCell<T>` to `T` because of
19541953
// #[repr(transparent)]. This exploits libstd's special status, there is

library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@
331331
#![feature(try_reserve)]
332332
#![feature(try_reserve_kind)]
333333
#![feature(unboxed_closures)]
334-
#![feature(unsafe_cell_raw_get)]
335334
#![feature(unwrap_infallible)]
336335
#![feature(vec_into_raw_parts)]
337336
#![feature(vec_spare_capacity)]

0 commit comments

Comments
 (0)