]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #88722 - WaffleLapkin:unsafe_cell_const_get_mut, r=dtolnay
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Mon, 13 Sep 2021 19:20:39 +0000 (21:20 +0200)
committerGitHub <noreply@github.com>
Mon, 13 Sep 2021 19:20:39 +0000 (21:20 +0200)
Make `UnsafeCell::get_mut` const

library/core/src/cell.rs

index 2adf6a549e6417b94349752487b39f76257fa727..e56b631dbaf8db537afb2bd8196e709ba074f396 100644 (file)
@@ -1916,7 +1916,8 @@ pub const fn get(&self) -> *mut 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
     }