From 302e33fde2785874c6b85aa9760e8e6be2e7dad4 Mon Sep 17 00:00:00 2001 From: Pointerbender Date: Mon, 12 Sep 2022 11:12:28 +0200 Subject: [PATCH] add description of the memory layout for `UnsafeCell` --- library/core/src/cell.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index fb4454c94cb3..cce4e5a59467 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -1811,6 +1811,8 @@ impl fmt::Display for RefMut<'_, T> { /// /// [`.get_mut()`]: `UnsafeCell::get_mut` /// +/// `UnsafeCell` 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