Skip to content

Commit

Permalink
Auto merge of #111711 - Jules-Bertholet:document-pin-layout, r=thomcc
Browse files Browse the repository at this point in the history
Document `Pin` memory layout

The fact that `Pin` is `#[repr(transparent)]` technically isn't documented anywhere currently. I don't see any reason why `Pin`'s layout would ever change, so this PR codifies it.

`@rustbot` label +T-libs-api -T-libs +A-docs +A-layout +A-pin
  • Loading branch information
bors committed May 22, 2023
2 parents 2d66e5a + f16acbe commit 48ec50a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ use crate::ops::{CoerceUnsized, Deref, DerefMut, DispatchFromDyn, Receiver};
/// value in place, preventing the value referenced by that pointer from being moved
/// unless it implements [`Unpin`].
///
/// `Pin<P>` is guaranteed to have the same memory layout and ABI as `P`.
///
/// *See the [`pin` module] documentation for an explanation of pinning.*
///
/// [`pin` module]: self
Expand Down

0 comments on commit 48ec50a

Please sign in to comment.