]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: doc: disable doc inlining for all prelude items
authorGary Guo <gary@garyguo.net>
Mon, 20 Apr 2026 16:16:36 +0000 (17:16 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 19 May 2026 22:47:24 +0000 (00:47 +0200)
Somehow the rustdoc heuristics determined that a large chunk of the items
found in prelude should have documentation inlined. This bloats the
generated 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,)
Link: https://rust.docs.kernel.org/next/kernel/prelude/trait.Zeroable.html#impl-Zeroable-for-(J,)
Signed-off-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260420161636.1790502-1-gary@kernel.org
[ Reworded for typo. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/prelude.rs

index 44edf72a4a24e2a63531d67f7578afd3f9b8b8a4..bcd4e7f90bc72d01987be42bf663298544354194 100644 (file)
@@ -22,6 +22,7 @@ pub use core::{
     pin::Pin, //
 };
 
+#[doc(no_inline)]
 pub use ::ffi::{
     c_char,
     c_int,
@@ -47,6 +48,7 @@ pub use macros::{
     vtable, //
 };
 
+#[doc(no_inline)]
 pub use pin_init::{
     init,
     pin_data,
@@ -58,6 +60,7 @@ pub use pin_init::{
     Zeroable, //
 };
 
+#[doc(no_inline)]
 pub use super::{
     alloc::{
         flags::*,