Re: [PATCH 1/2] rust: allow `unreachable_pub` for doctests

From: Benno Lossin

Date: Mon Nov 10 2025 - 09:39:20 EST


On Mon Nov 10, 2025 at 12:35 PM CET, Miguel Ojeda wrote:
> Examples (i.e. doctests) may want to show public items such as structs,
> thus the `unreachable_pub` warning is not very helpful.
>
> Thus allow it for all doctests.
>
> In addition, remove it from the existing `expect`s we have in a couple
> doctests.
>
> Suggested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Link: https://lore.kernel.org/rust-for-linux/aRG9VjsaCjsvAwUn@xxxxxxxxxx/
> Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>

Acked-by: Benno Lossin <lossin@xxxxxxxxxx>

Cheers,
Benno

> ---
> rust/kernel/init.rs | 2 +-
> rust/kernel/types.rs | 2 +-
> scripts/rustdoc_test_gen.rs | 1 +
> 3 files changed, 3 insertions(+), 2 deletions(-)