From 002f627d383597a792afa14a8b9046659dabdaa2 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Mon, 14 Feb 2022 17:35:27 +0100 Subject: [PATCH] Add a comment to justify why the `pointer` field is `pub`. Addresses https://github.com/rust-lang/rust/pull/93176/files#r795258110. --- library/core/src/pin.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs index 84fed4ed243..dec1b5270d5 100644 --- a/library/core/src/pin.rs +++ b/library/core/src/pin.rs @@ -406,6 +406,11 @@ #[repr(transparent)] #[derive(Copy, Clone)] pub struct Pin

{ + // 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, -- 2.44.0