mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
add "Memory layout" subsection to documentation of UnsafeCell for additional clarity
This commit is contained in:
@@ -1816,6 +1816,8 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
///
|
||||
/// [`.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
|
||||
|
||||
Reference in New Issue
Block a user