mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
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>
This commit is contained in:
committed by
Miguel Ojeda
parent
4b4d06a763
commit
1f96115f50
@@ -7,7 +7,6 @@
|
||||
use super::{AllocError, Allocator, Flags};
|
||||
use core::alloc::Layout;
|
||||
use core::borrow::{Borrow, BorrowMut};
|
||||
use core::fmt;
|
||||
use core::marker::PhantomData;
|
||||
use core::mem::ManuallyDrop;
|
||||
use core::mem::MaybeUninit;
|
||||
@@ -17,6 +16,7 @@
|
||||
use core::result::Result;
|
||||
|
||||
use crate::ffi::c_void;
|
||||
use crate::fmt;
|
||||
use crate::init::InPlaceInit;
|
||||
use crate::types::ForeignOwnable;
|
||||
use pin_init::{InPlaceWrite, Init, PinInit, ZeroableOption};
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
layout::ArrayLayout,
|
||||
AllocError, Allocator, Box, Flags,
|
||||
};
|
||||
use crate::fmt;
|
||||
use core::{
|
||||
borrow::{Borrow, BorrowMut},
|
||||
fmt,
|
||||
marker::PhantomData,
|
||||
mem::{ManuallyDrop, MaybeUninit},
|
||||
ops::Deref,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
//! Errors for the [`Vec`] type.
|
||||
|
||||
use core::fmt::{self, Debug, Formatter};
|
||||
use kernel::fmt::{self, Debug, Formatter};
|
||||
use kernel::prelude::*;
|
||||
|
||||
/// Error type for [`Vec::push_within_capacity`].
|
||||
|
||||
Reference in New Issue
Block a user