add description of the memory layout for UnsafeCell<T>

This commit is contained in:
Pointerbender 2022-09-12 11:12:28 +02:00
parent 56e7678ca9
commit 302e33fde2

View file

@ -1811,6 +1811,8 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
///
/// [`.get_mut()`]: `UnsafeCell::get_mut`
///
/// `UnsafeCell<T>` has the same in-memory representation as its inner type `T`.
///
/// # Examples
///
/// Here is an example showcasing how to soundly mutate the contents of an `UnsafeCell<_>` despite