Re: [PATCH] rust: driver: fix broken intra-doc links to example driver types

From: Alice Ryhl

Date: Tue Dec 30 2025 - 17:59:29 EST


On Tue, Dec 30, 2025 at 10:18 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Sat, Dec 27, 2025 at 4:47 PM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
> >
> > The `auxiliary` and `pci` modules are conditional on
> > `CONFIG_AUXILIARY_BUS` and `CONFIG_PCI` respectively. When these are
> > disabled, the intra-doc links to `auxiliary::Driver` and `pci::Driver`
> > break, causing rustdoc warnings (or errors with `-D warnings`).
> >
> > error: unresolved link to `kernel::auxiliary::Driver`
> > --> rust/kernel/driver.rs:82:28
> > |
> > 82 | //! [`auxiliary::Driver`]: kernel::auxiliary::Driver
> > | ^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `auxiliary` in module `kernel`
> >
> > Fix this by making the documentation for these examples conditional on
> > the corresponding configuration options.
> >
> > Fixes: 970a7c68788e ("driver: rust: expand documentation for driver infrastructure")
> > Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
>
> Reported-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>
> Closes: https://lore.kernel.org/rust-for-linux/20251209.151817.744108529426448097.fujita.tomonori@xxxxxxxxx/
>
> Tomo: do you want to send the other cases in your diff as a patch? Thanks!
>
> This patch, together with Tomo's diff, will likely clean UML in 6.18.y
> as well (Cc'ing David).

Ah, I thought I had seen someone else run into this somewhere, but I
couldn't find it. Thanks for digging it up!

Alice