rust: pin-init: reduce visibility of projection methods to declutter rustdoc
Status from this message: Applied, thanks!
Get series with b4
b4 am [email protected] change-id 20261118-dev-project-vis-ff83ea9e6926Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | rust: pin-init: internal: allow `clippy::large_unopt_stack_frames`rust/ | +1 | 3 replies | |
| 2/3 | rust: pin-init: internal: use visibility of the most visible field for projectionrust/ rust/ | +67 | 0 replies | |
| 3/3 | rust: pin-init: internal: hide `HasPinData` implrust/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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]>