summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec/errors.rs
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2026-03-19 12:16:46 +0000
committerMiguel Ojeda <ojeda@kernel.org>2026-03-30 02:03:49 +0200
commit560a7a9b9267fbe31a68270ca0ad22b6a4db44a5 (patch)
treefc1b22fd60a0e9a64a8e01ea42015a61df6dba64 /rust/kernel/alloc/kvec/errors.rs
parentabfe5ee9971249b91020b5053afcaad43837336a (diff)
rust: add `const_assert!` macro
The macro is a more powerful version of `static_assert!` for use inside function contexts. This is powered by inline consts, so enable the feature for old compiler versions that does not have it stably. While it is possible already to write `const { assert!(...) }`, this provides a short hand that is more uniform with other assertions. It also formats nicer with rustfmt where it will not be formatted into multiple lines. Two users that would route via the Rust tree are converted. Reviewed-by: Yury Norov <ynorov@nvidia.com> Signed-off-by: Gary Guo <gary@garyguo.net> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260319121653.2975748-3-gary@kernel.org [ Rebased. Fixed period typo. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions