about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPointerbender <pointerbender@gmail.com>2022-09-12 11:12:28 +0200
committerPointerbender <pointerbender@gmail.com>2022-09-12 11:12:28 +0200
commit302e33fde2785874c6b85aa9760e8e6be2e7dad4 (patch)
tree1ec675cdbb2c7d96be39e2ba21e768e00ccfeee8
parent56e7678ca97e9740f7d09206f767d5bb676917f7 (diff)
downloadrust-302e33fde2785874c6b85aa9760e8e6be2e7dad4.tar.gz
rust-302e33fde2785874c6b85aa9760e8e6be2e7dad4.zip
add description of the memory layout for `UnsafeCell<T>`
-rw-r--r--library/core/src/cell.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index fb4454c94cb..cce4e5a5946 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -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