Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 [1]
Link: https://lore.kernel.org/rust-for-linux/CANiq72kOLYR2A95o0ji2mDmEqOKh9e9_60zZKmgF=vZmsW6DRg@mail.gmail.com/ [2]
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>

+4 -1
+4 -1
rust/kernel/prelude.rs
··· 12 12 //! ``` 13 13 14 14 #[doc(no_inline)] 15 - pub use core::pin::Pin; 15 + pub use core::{ 16 + mem::{align_of, align_of_val, size_of, size_of_val}, 17 + pin::Pin, 18 + }; 16 19 17 20 pub use ::ffi::{ 18 21 c_char, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint, c_ulong, c_ulonglong,