[PATCH 1/1] rust: prelude: improve generated docs for `build_assert`

From: melihemik

Date: Tue Jul 07 2026 - 03:53:49 EST


The build assertion macros are documented in the `build_assert` module,
where rustdoc can show their purpose, where each macro should be used and
how a failed assertion is reported during compilation.

After the macro definitions were hidden to avoid duplicate root-level
documentation, however, rustdoc stopped rendering the explicit
`build_assert::{...}` re-exports on the prelude page. Readers of the
generated prelude documentation can no longer tell that `build_assert!`
and the related macros are brought into scope by `kernel::prelude::*`.

Use a glob re-export from the canonical module so rustdoc renders the
prelude entry as a re-export without inlining another copy of the macro
documentation.

Suggested-by: Gary Guo <gary@xxxxxxxxxxx>
Link: https://github.com/Rust-for-Linux/linux/issues/1242
Signed-off-by: melihemik <melihemik@xxxxxxxxxxx>
---
rust/kernel/prelude.rs | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs
index ca396f1f78a6..b65f718d72bf 100644
--- a/rust/kernel/prelude.rs
+++ b/rust/kernel/prelude.rs
@@ -85,12 +85,7 @@
VVec,
Vec, //
},
- build_assert::{
- build_assert,
- build_error,
- const_assert,
- static_assert, //
- },
+ build_assert::*,
current,
dev_alert,
dev_crit,
--
2.55.0