Rollup merge of #88722 - WaffleLapkin:unsafe_cell_const_get_mut, r=dtolnay

Make `UnsafeCell::get_mut` const
This commit is contained in:
Guillaume Gomez 2021-09-13 21:20:39 +02:00 committed by GitHub
commit 5eb77838ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 = "88836")]
pub const fn get_mut(&mut self) -> &mut T {
&mut self.value
}