Guarantee the memory layout of Cell
This commit is contained in:
parent
ae4d89dfb5
commit
660d985d12
1 changed files with 6 additions and 0 deletions
|
@ -209,6 +209,12 @@ pub use once::OnceCell;
|
||||||
|
|
||||||
/// A mutable memory location.
|
/// A mutable memory location.
|
||||||
///
|
///
|
||||||
|
/// # Memory layout
|
||||||
|
///
|
||||||
|
/// `Cell<T>` has the same [memory layout and caveats as
|
||||||
|
/// `UnsafeCell<T>`](UnsafeCell#memory-layout). In particular, this means that
|
||||||
|
/// `Cell<T>` has the same in-memory representation as its inner type `T`.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// In this example, you can see that `Cell<T>` enables mutation inside an
|
/// In this example, you can see that `Cell<T>` enables mutation inside an
|
||||||
|
|
Loading…
Add table
Reference in a new issue