Make UnsafeCell::get_mut const

This commit is contained in:
Waffle 2021-09-07 16:41:15 +03:00
parent 385f8e2078
commit efeb461873

View file

@ -1916,7 +1916,8 @@ impl<T: ?Sized> UnsafeCell<T> {
/// ```
#[inline(always)]
#[stable(feature = "unsafe_cell_get_mut", since = "1.50.0")]
pub fn get_mut(&mut self) -> &mut T {
#[rustc_const_unstable(feature = "const_unsafecell_get_mut", issue = "none")]
pub const fn get_mut(&mut self) -> &mut T {
&mut self.value
}