* [PATCH] rust: doc: disable doc inlining for all prelude items
@ 2026-04-20 16:16 Gary Guo
2026-04-27 7:31 ` Alice Ryhl
0 siblings, 1 reply; 2+ messages in thread
From: Gary Guo @ 2026-04-20 16:16 UTC (permalink / raw)
To: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich
Cc: rust-for-linux, linux-kernel
From: Gary Guo <gary@garyguo.net>
Somehow the rustdoc heuristics determined that a large chunk of the items
found in prelude should have documentation inlined. This bloats the
generate documentation size.
Also, for crates that optimize documentation with `cfg(doc)`, as the
documentation inlining makes use of the metadata compiled by just rustc, it
will not pick up the `cfg(doc)` attributes from the inlined documentation.
pin-init for example optimizes tuple/fn rendering using the nightly
fake_variadic feature [1], but this is missing from the inlined version
[2].
Thus, mark all prelude items as `#[doc(no_inline)]`.
Link: https://rust.docs.kernel.org/next/pin_init/trait.Zeroable.html#impl-Zeroable-for-(J,) [1]
Link: https://rust.docs.kernel.org/next/kernel/prelude/trait.Zeroable.html#impl-Zeroable-for-(J,) [2]
Signed-off-by: Gary Guo <gary@garyguo.net>
---
rust/kernel/prelude.rs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs
index 44edf72a4a24..bcd4e7f90bc7 100644
--- a/rust/kernel/prelude.rs
+++ b/rust/kernel/prelude.rs
@@ -22,6 +22,7 @@
pin::Pin, //
};
+#[doc(no_inline)]
pub use ::ffi::{
c_char,
c_int,
@@ -47,6 +48,7 @@
vtable, //
};
+#[doc(no_inline)]
pub use pin_init::{
init,
pin_data,
@@ -58,6 +60,7 @@
Zeroable, //
};
+#[doc(no_inline)]
pub use super::{
alloc::{
flags::*,
base-commit: 1c7cc4904160c6fc6377564140062d68a3dc93a0
--
2.51.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rust: doc: disable doc inlining for all prelude items
2026-04-20 16:16 [PATCH] rust: doc: disable doc inlining for all prelude items Gary Guo
@ 2026-04-27 7:31 ` Alice Ryhl
0 siblings, 0 replies; 2+ messages in thread
From: Alice Ryhl @ 2026-04-27 7:31 UTC (permalink / raw)
To: Gary Guo
Cc: Miguel Ojeda, Boqun Feng, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Danilo Krummrich, rust-for-linux,
linux-kernel
On Mon, Apr 20, 2026 at 05:16:36PM +0100, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> Somehow the rustdoc heuristics determined that a large chunk of the items
> found in prelude should have documentation inlined. This bloats the
> generate documentation size.
>
> Also, for crates that optimize documentation with `cfg(doc)`, as the
> documentation inlining makes use of the metadata compiled by just rustc, it
> will not pick up the `cfg(doc)` attributes from the inlined documentation.
> pin-init for example optimizes tuple/fn rendering using the nightly
> fake_variadic feature [1], but this is missing from the inlined version
> [2].
>
> Thus, mark all prelude items as `#[doc(no_inline)]`.
>
> Link: https://rust.docs.kernel.org/next/pin_init/trait.Zeroable.html#impl-Zeroable-for-(J,) [1]
> Link: https://rust.docs.kernel.org/next/kernel/prelude/trait.Zeroable.html#impl-Zeroable-for-(J,) [2]
> Signed-off-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-27 7:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 16:16 [PATCH] rust: doc: disable doc inlining for all prelude items Gary Guo
2026-04-27 7:31 ` Alice Ryhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox