about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-09-13 21:20:39 +0200
committerGitHub <noreply@github.com>2021-09-13 21:20:39 +0200
commit5eb77838eaa414319dfb50e57cb9d7b459aa0341 (patch)
tree8a653ce45234e6c77b50d2140e95be2242956d3d
parentb3bb7868f8ec0c9e0e7b8c93d5ab49c3e9665486 (diff)
parent2c30162380ac06e5e6b084164ee6ba596a9398f0 (diff)
downloadrust-5eb77838eaa414319dfb50e57cb9d7b459aa0341.tar.gz
rust-5eb77838eaa414319dfb50e57cb9d7b459aa0341.zip
Rollup merge of #88722 - WaffleLapkin:unsafe_cell_const_get_mut, r=dtolnay
Make `UnsafeCell::get_mut` const
-rw-r--r--library/core/src/cell.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index 2adf6a549e6..e56b631dbaf 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -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
     }