Re: [PATCH] rust: list: hide macros from top-level kernel doc
From: Miguel Ojeda
Date: Fri Mar 27 2026 - 07:27:19 EST
On Thu, Mar 12, 2026 at 6:47 PM Gary Guo <gary@xxxxxxxxxx> wrote:
>
> From: Gary Guo <gary@xxxxxxxxxxx>
>
> Due to Rust macro scoping rules, all macros defined in a crate using
> `#[macro_export]` end up in the top-level. For the list macros, we
> re-export them inside the list module, and expect users to use
> `kernel::list::macro_name!()`.
>
> Use `#[doc(hidden)]` on the macro definition, and use `#[doc(inline)]` on
> the re-export to make the macro appear to be defined at module-level inside
> documentation.
>
> The other exported types are already automatically `#[doc(inline)]` because
> they are defined in a non-public module, so there is no need to split the
> macro re-exports out.
>
> Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
Applied to `rust-next` -- thanks!
Nice, this cleans up a bit further the top-level macro list in the
generated docs.
Cheers,
Miguel