summaryrefslogtreecommitdiff
path: root/rust/kernel/prelude.rs
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2026-03-19 12:16:45 +0000
committerMiguel Ojeda <ojeda@kernel.org>2026-03-28 23:16:52 +0100
commitabfe5ee9971249b91020b5053afcaad43837336a (patch)
tree12326a59ffa9cd56040be8c7dd99b25cfa6a61ba /rust/kernel/prelude.rs
parent4f13c93497e366cd8e41561a8e30ad4da887cb82 (diff)
downloadlinux-next-abfe5ee9971249b91020b5053afcaad43837336a.tar.gz
linux-next-abfe5ee9971249b91020b5053afcaad43837336a.zip
rust: move `static_assert` into `build_assert`
Conceptually, `static_assert` is also a build-time assertion that occurs earlier in the pipeline. Consolidate the implementation so that we can use this as the canonical place to add more useful build-time assertions. Reviewed-by: Yury Norov <ynorov@nvidia.com> Signed-off-by: Gary Guo <gary@garyguo.net> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260319121653.2975748-2-gary@kernel.org [ Used kernel vertical style. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/prelude.rs')
-rw-r--r--rust/kernel/prelude.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs
index 2877e3f7b6d3..2e9454472818 100644
--- a/rust/kernel/prelude.rs
+++ b/rust/kernel/prelude.rs
@@ -29,7 +29,11 @@ pub use macros::{export, fmt, kunit_tests, module, vtable};
pub use pin_init::{init, pin_data, pin_init, pinned_drop, InPlaceWrite, Init, PinInit, Zeroable};
-pub use super::{build_assert, build_error};
+pub use super::{
+ build_assert,
+ build_error,
+ static_assert, //
+};
// `super::std_vendor` is hidden, which makes the macro inline for some reason.
#[doc(no_inline)]
@@ -39,8 +43,6 @@ pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notic
pub use super::{try_init, try_pin_init};
-pub use super::static_assert;
-
pub use super::error::{code::*, Error, Result};
pub use super::{str::CStrExt as _, ThisModule};