Skip to content

Commit 5eb7783

Browse files
Rollup merge of #88722 - WaffleLapkin:unsafe_cell_const_get_mut, r=dtolnay
Make `UnsafeCell::get_mut` const
2 parents b3bb786 + 2c30162 commit 5eb7783

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/cell.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,8 @@ impl<T: ?Sized> UnsafeCell<T> {
19161916
/// ```
19171917
#[inline(always)]
19181918
#[stable(feature = "unsafe_cell_get_mut", since = "1.50.0")]
1919-
pub fn get_mut(&mut self) -> &mut T {
1919+
#[rustc_const_unstable(feature = "const_unsafecell_get_mut", issue = "88836")]
1920+
pub const fn get_mut(&mut self) -> &mut T {
19201921
&mut self.value
19211922
}
19221923

0 commit comments

Comments
 (0)