mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Guarantee the memory layout of Cell
This commit is contained in:
parent
ae4d89dfb5
commit
660d985d12
@ -209,6 +209,12 @@ pub use once::OnceCell;
|
||||
|
||||
/// 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
|
||||
|
Loading…
Reference in New Issue
Block a user