]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rust: pin-init: doc: de-clutter documentation with fake-variadics
authorGary Guo <gary@garyguo.net>
Thu, 19 Mar 2026 09:35:26 +0000 (10:35 +0100)
committerBenno Lossin <lossin@kernel.org>
Wed, 25 Mar 2026 09:57:16 +0000 (10:57 +0100)
commit44f6fa0dced7babfbfd08683fe376b0c72ebbec7
tree0125bbecfe1387fba3b88a22231accfae14dff72
parent960c37cbcba78730ee175f4887ffcdf523385c53
rust: pin-init: doc: de-clutter documentation with fake-variadics

Currently the doc for `Zeroable` and `ZeroableOption` are filled with the
generated impl of tuples and fn pointers. Use the internal
"fake_variadics" feature to improve the rendered quality.

This makes use of an internal feature, however this is of minimal risk as
it's for documentation only, not activated during normal build, gated
behind `USE_RUSTC_FEATURES`, and can be removed at any time. This feature
is already used by serde and bevy to improve documentation quality.

For compilers that cannot use this feature, we still hide most generated
impls, and the existence of them are hinted by doc comments on the single
non-hidden impl.

Signed-off-by: Gary Guo <gary@garyguo.net>
Link: https://github.com/Rust-for-Linux/pin-init/commit/530c4eb79a449599e219821f9397f03250cc2aa4
[ Reordered `#[doc]` attributes and safety comments to avoid errors in
  older versions of clippy. - Benno ]
Link: https://patch.msgid.link/20260319093542.3756606-4-lossin@kernel.org
Signed-off-by: Benno Lossin <lossin@kernel.org>
rust/pin-init/src/lib.rs