Re: [PATCH] rust: doc: disable doc inlining for all prelude items

From: Miguel Ojeda

Date: Tue May 19 2026 - 18:54:06 EST


On Mon, Apr 20, 2026 at 6:16 PM Gary Guo <gary@xxxxxxxxxx> wrote:
>
> From: Gary Guo <gary@xxxxxxxxxxx>
>
> 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@xxxxxxxxxxx>

Applied to `rust-next` -- thanks everyone!

[ Reworded for typo. - Miguel ]

Cheers,
Miguel