From: Gary Guo <gary@kernel.org>
To: "Benno Lossin" <lossin@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>
Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
Gary Guo <gary@garyguo.net>
Subject: [PATCH 0/3] rust: pin-init: reduce visibility of projection methods to declutter rustdoc
Date: Wed, 18 Nov 2026 14:31:19 +0000 [thread overview]
Message-ID: <20261118-dev-project-vis-v1-0-2a5f433bb516@garyguo.net> (raw)
Currently all types that use `#[pin_data]` will have projection method
generated and visible in rustdoc. But for many types, all fields are
private and thus these projection methods are not useful as public APIs.
Thus, compute a least upper bound (LUB) of field visibility and use that as
visibility for projection methods instead. This means that if none of the
fields are accessible publicly, the projection methods won't be as well and
thus will be hidden from rustdoc.
We could also just mark these methods as `#[doc(hidden)]` -- but LSPs will
hide these methods too -- and bthese are indeed APIs that people would want
to use.
Signed-off-by: Gary Guo <gary@garyguo.net>
---
Gary Guo (3):
rust: pin-init: internal: allow `clippy::large_unopt_stack_frames`
rust: pin-init: internal: use visibility of the most visible field for projection
rust: pin-init: internal: hide `HasPinData` impl
rust/pin-init/internal/src/init.rs | 2 +-
rust/pin-init/internal/src/pin_data.rs | 36 ++++++++++++++++----------
rust/pin-init/internal/src/util.rs | 47 +++++++++++++++++++++++++++++++++-
3 files changed, 69 insertions(+), 16 deletions(-)
---
base-commit: b7218f1996f8491dbe28632b70f444cb73f554df
change-id: 20261118-dev-project-vis-ff83ea9e6926
Best regards,
--
Gary Guo <gary@garyguo.net>
next reply other threads:[~2026-11-18 14:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 14:31 Gary Guo [this message]
2026-11-18 14:31 ` [PATCH 1/3] rust: pin-init: internal: allow `clippy::large_unopt_stack_frames` Gary Guo
2026-11-18 14:31 ` [PATCH 2/3] rust: pin-init: internal: use visibility of the most visible field for projection Gary Guo
2026-11-18 14:31 ` [PATCH 3/3] rust: pin-init: internal: hide `HasPinData` impl Gary Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261118-dev-project-vis-v1-0-2a5f433bb516@garyguo.net \
--to=gary@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®