]> Gentwo Git Trees - linux/.git/commit
rust: allow `unreachable_pub` for doctests
authorMiguel Ojeda <ojeda@kernel.org>
Mon, 10 Nov 2025 11:35:27 +0000 (12:35 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 17 Nov 2025 07:41:31 +0000 (08:41 +0100)
commitab844cf32058d6ba9bd98a921afa2256085e21fc
treee6643efdd771ef753a7b03b6b31c1a40fe64bdaf
parentbf724be7f00cf2cbafc105422476f6242e917a90
rust: allow `unreachable_pub` for doctests

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@google.com>
Link: https://lore.kernel.org/rust-for-linux/aRG9VjsaCjsvAwUn@google.com/
Reviewed-by: David Gow <davidgow@google.com>
Acked-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20251110113528.1658238-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/init.rs
rust/kernel/types.rs
scripts/rustdoc_test_gen.rs