rust: prelude: re-export `core::mem::{align,size}_of{,_val}`
authorMiguel Ojeda <ojeda@kernel.org>
Fri, 1 Aug 2025 16:17:52 +0000 (18:17 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 7 Sep 2025 22:11:19 +0000 (00:11 +0200)
commit72b04a8af7fb11e0f12e52985543d7e699fd4406
tree1403fae3f1ea21e361ed903da490f2bd7294e7b6
parent6d65ccac394c7539e710c569e21067f617493171
rust: prelude: re-export `core::mem::{align,size}_of{,_val}`

Rust 1.80.0 added:

    align_of
    align_of_val
    size_of
    size_of_val

from `core::mem` to the prelude [1].

For similar reasons, and to minimize potential confusion when code may
work in later versions but not in our current minimum, add it to our
prelude too.

Link: https://github.com/rust-lang/rust/pull/123168
Link: https://lore.kernel.org/rust-for-linux/CANiq72kOLYR2A95o0ji2mDmEqOKh9e9_60zZKmgF=vZmsW6DRg@mail.gmail.com/
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/prelude.rs