Skip to content

rust: pin-init: reduce visibility of projection methods to declutter rustdoc

Gary Guo lkml rust-for-linux 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected] change-id 20261118-dev-project-vis-ff83ea9e6926

Versions newest first

  1. v1 Latest3 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3rust: pin-init: internal: allow `clippy::large_unopt_stack_frames`rust/pin-init/internal/src/init.rs+1 -13 replies
2/3rust: pin-init: internal: use visibility of the most visible field for projectionrust/pin-init/internal/src/pin_data.rs rust/pin-init/internal/src/util.rs+67 -150 replies
3/3rust: pin-init: internal: hide `HasPinData` implrust/pin-init/internal/src/pin_data.rs+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] rust: pin-init: reduce visibility of projection methods to declutter rustdoc

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.

---
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,

Signature · 1 line
Gary Guo <[email protected]>