diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-09-13 21:20:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-13 21:20:39 +0200 |
| commit | 5eb77838eaa414319dfb50e57cb9d7b459aa0341 (patch) | |
| tree | 8a653ce45234e6c77b50d2140e95be2242956d3d | |
| parent | b3bb7868f8ec0c9e0e7b8c93d5ab49c3e9665486 (diff) | |
| parent | 2c30162380ac06e5e6b084164ee6ba596a9398f0 (diff) | |
| download | rust-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.rs | 3 |
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 } |
