Skip to content

Commit

Permalink
add "Memory layout" subsection to documentation of UnsafeCell for a…
Browse files Browse the repository at this point in the history
…dditional clarity
  • Loading branch information
Pointerbender committed Oct 27, 2022
1 parent 5673536 commit 166d8b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 166d8b8

Please sign in to comment.