Skip to content

Commit

Permalink
Rollup merge of rust-lang#88722 - WaffleLapkin:unsafe_cell_const_get_…
Browse files Browse the repository at this point in the history
…mut, r=dtolnay

Make `UnsafeCell::get_mut` const
  • Loading branch information
workingjubilee committed Sep 12, 2021
2 parents 9116186 + 2c30162 commit 3dc37c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 3dc37c6

Please sign in to comment.