mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
Guarantee the memory layout of Cell
This commit is contained in:
@@ -209,6 +209,12 @@
|
||||
|
||||
/// 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
|
||||
///
|
||||
/// In this example, you can see that `Cell<T>` enables mutation inside an
|
||||
|
||||
Reference in New Issue
Block a user