On Mon, Nov 10, 2025 at 12:35:27PM +0100, 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 <[email protected]>
> Link: https://lore.kernel.org/rust-for-linux/[email protected]/
> Signed-off-by: Miguel Ojeda <[email protected]>

Reviewed-by: Alice Ryhl <[email protected]>

>  rust/kernel/init.rs         | 2 +-
>  rust/kernel/types.rs        | 2 +-
>  scripts/rustdoc_test_gen.rs | 1 +
>  3 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs
> index 4949047af8d7..e476d81c1a27 100644
> --- a/rust/kernel/init.rs
> +++ b/rust/kernel/init.rs
> @@ -67,7 +67,7 @@
>  //! ```
>  //!
>  //! ```rust
> -//! # #![expect(unreachable_pub, clippy::disallowed_names)]
> +//! # #![expect(clippy::disallowed_names)]

Maybe we should also allow disallowed_names in doc tests?

Alice

Reply via email to