Skip to content

Commit cd2fddd

Browse files
committed
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: rust-lang/rust#123168 [1] Link: https://lore.kernel.org/rust-for-linux/CANiq72kOLYR2A95o0ji2mDmEqOKh9e9_60zZKmgF=vZmsW6DRg@mail.gmail.com/ [2] Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Reviewed-by: Andreas Hindborg <[email protected]> Reviewed-by: Daniel Almeida <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 808c933 commit cd2fddd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rust/kernel/prelude.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
//! ```
1313
1414
#[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+
};
1619

1720
pub use ::ffi::{
1821
c_char, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint, c_ulong, c_ulonglong,

0 commit comments

Comments
 (0)