Rollup merge of #78735 - danielhenrymantilla:simplify-unsafecell-getmut, r=RalfJung
Simplify the implementation of `get_mut` (no unsafe) Quick PR to reduce one use of `unsafe` pointed out in the previous PR r? ````@RalfJung````
This commit is contained in:
commit
29fad213b2
@ -1733,8 +1733,7 @@ impl<T: ?Sized> UnsafeCell<T> {
|
||||
#[inline]
|
||||
#[unstable(feature = "unsafe_cell_get_mut", issue = "76943")]
|
||||
pub fn get_mut(&mut self) -> &mut T {
|
||||
// SAFETY: (outer) `&mut` guarantees unique access.
|
||||
unsafe { &mut *self.get() }
|
||||
&mut self.value
|
||||
}
|
||||
|
||||
/// Gets a mutable pointer to the wrapped value.
|
||||
|
Loading…
Reference in New Issue
Block a user