Skip to content

Commit

Permalink
Guarantee the memory layout of Cell
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jan 24, 2023
1 parent ae4d89d commit 660d985
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 660d985

Please sign in to comment.