Auto merge of #111711 - Jules-Bertholet:document-pin-layout, r=thomcc

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
This commit is contained in:
bors 2023-05-22 09:35:51 +00:00
commit 48ec50ae39

View File

@ -393,6 +393,8 @@
/// 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