]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/pin.rs
Add a comment to justify why the `pointer` field is `pub`.
[rust.git] / library / core / src / pin.rs
index 84fed4ed24364dd74928c281379c7b1fb6d7659b..dec1b5270d58b559534c7472997539de55d44575 100644 (file)
 #[repr(transparent)]
 #[derive(Copy, Clone)]
 pub struct Pin<P> {
+    // FIXME(#93176): this field is made `#[unstable] #[doc(hidden)] pub` to:
+    //   - deter downstream users from accessing it (which would be unsound!),
+    //   - let the `pin!` macro access it (such a macro requires using struct
+    //     literal syntax in order to benefit from lifetime extension).
+    // Long-term, `unsafe` fields or macro hygiene are expected to offer more robust alternatives.
     #[unstable(feature = "unsafe_pin_internals", issue = "none")]
     #[doc(hidden)]
     pub pointer: P,