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: alloc: use `kernel::{fmt,prelude::fmt!}`

Reduce coupling to implementation details of the formatting machinery by
avoiding direct use for `core`'s formatting traits and macros.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Tamir Duberstein and committed by
Miguel Ojeda
1f96115f 4b4d06a7

+3 -3
+1 -1
rust/kernel/alloc/kbox.rs
··· 7 7 use super::{AllocError, Allocator, Flags}; 8 8 use core::alloc::Layout; 9 9 use core::borrow::{Borrow, BorrowMut}; 10 - use core::fmt; 11 10 use core::marker::PhantomData; 12 11 use core::mem::ManuallyDrop; 13 12 use core::mem::MaybeUninit; ··· 16 17 use core::result::Result; 17 18 18 19 use crate::ffi::c_void; 20 + use crate::fmt; 19 21 use crate::init::InPlaceInit; 20 22 use crate::types::ForeignOwnable; 21 23 use pin_init::{InPlaceWrite, Init, PinInit, ZeroableOption};
+1 -1
rust/kernel/alloc/kvec.rs
··· 7 7 layout::ArrayLayout, 8 8 AllocError, Allocator, Box, Flags, 9 9 }; 10 + use crate::fmt; 10 11 use core::{ 11 12 borrow::{Borrow, BorrowMut}, 12 - fmt, 13 13 marker::PhantomData, 14 14 mem::{ManuallyDrop, MaybeUninit}, 15 15 ops::Deref,
+1 -1
rust/kernel/alloc/kvec/errors.rs
··· 2 2 3 3 //! Errors for the [`Vec`] type. 4 4 5 - use core::fmt::{self, Debug, Formatter}; 5 + use kernel::fmt::{self, Debug, Formatter}; 6 6 use kernel::prelude::*; 7 7 8 8 /// Error type for [`Vec::push_within_capacity`].