mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] rust: pin-init: reduce visibility of projection methods to declutter rustdoc
@ 2026-11-18 14:31 Gary Guo
  2026-11-18 14:31 ` [PATCH 1/3] rust: pin-init: internal: allow `clippy::large_unopt_stack_frames` Gary Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gary Guo @ 2026-11-18 14:31 UTC (permalink / raw)
  To: Benno Lossin, Miguel Ojeda, Boqun Feng, Björn Roy Baron,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	Daniel Almeida, Tamir Duberstein, Alexandre Courbot,
	Onur Özkan
  Cc: rust-for-linux, linux-kernel, Gary Guo

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>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-18 14:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 14:31 [PATCH 0/3] rust: pin-init: reduce visibility of projection methods to declutter rustdoc Gary Guo
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

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®