Skip to content

Commit 48ec50a

Browse files
committed
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
2 parents 2d66e5a + f16acbe commit 48ec50a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/pin.rs

+2
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ use crate::ops::{CoerceUnsized, Deref, DerefMut, DispatchFromDyn, Receiver};
393393
/// value in place, preventing the value referenced by that pointer from being moved
394394
/// unless it implements [`Unpin`].
395395
///
396+
/// `Pin<P>` is guaranteed to have the same memory layout and ABI as `P`.
397+
///
396398
/// *See the [`pin` module] documentation for an explanation of pinning.*
397399
///
398400
/// [`pin` module]: self

0 commit comments

Comments
 (0)