diff options
| author | Pointerbender <pointerbender@gmail.com> | 2022-10-27 06:32:36 +0200 |
|---|---|---|
| committer | Pointerbender <pointerbender@gmail.com> | 2022-10-27 06:32:36 +0200 |
| commit | 166d8b8c2b282ba0d0cf4da277cf8829d30df94b (patch) | |
| tree | 378e4244bf6bac5c4a3be21a3f0b628fc3fba641 | |
| parent | 56735361536773aee70f44b76438d1a07b7062e3 (diff) | |
add "Memory layout" subsection to documentation of `UnsafeCell` for additional clarity
| -rw-r--r-- | library/core/src/cell.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index fe5dd7be8f6..7bf32cb0d98 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -1816,6 +1816,8 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> { /// /// [`.get_mut()`]: `UnsafeCell::get_mut` /// +/// # Memory layout +/// /// `UnsafeCell<T>` has the same in-memory representation as its inner type `T`. A consequence /// of this guarantee is that it is possible to convert between `T` and `UnsafeCell<T>`. /// Special care has to be taken when converting a nested `T` inside of an `Outer<T>` type |
