diff options
| author | Mads Marquart <mads@marquart.dk> | 2023-01-15 22:39:43 +0100 |
|---|---|---|
| committer | Mads Marquart <mads@marquart.dk> | 2023-01-24 20:59:39 +0100 |
| commit | 660d985d12bd66dde21490fefb31c9b7fb22a67e (patch) | |
| tree | 49e4fe177da39922c685f16c06cf24568754d688 | |
| parent | ae4d89dfb51535c1c43052ef848564bd2323c9ca (diff) | |
| download | rust-660d985d12bd66dde21490fefb31c9b7fb22a67e.tar.gz rust-660d985d12bd66dde21490fefb31c9b7fb22a67e.zip | |
Guarantee the memory layout of `Cell`
| -rw-r--r-- | library/core/src/cell.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index 129213fde74..c65c30e566a 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -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 |
