rust: error: import kernel's LayoutError instead of core's

Import the internal (`kernel::alloc`) version of `LayoutError` instead
of the `core::alloc` one.

In particular, this results in switching the type in the existing
`From<LayoutError> for Error` implementation.

Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Jimmy Ostler <jtostler1@gmail.com>
Link: https://lore.kernel.org/r/fe58a02189e8804a9eabdd01cb1927d4c491d79c.1734674670.git.jtostler1@gmail.com
[ Reworded commit. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
Jimmy Ostler 2024-12-19 22:25:31 -08:00 committed by Miguel Ojeda
parent b6357e2686
commit 7871c612ca

View File

@ -4,9 +4,10 @@
//!
//! C header: [`include/uapi/asm-generic/errno-base.h`](srctree/include/uapi/asm-generic/errno-base.h)
use crate::{alloc::AllocError, str::CStr};
use core::alloc::LayoutError;
use crate::{
alloc::{layout::LayoutError, AllocError},
str::CStr,
};
use core::fmt;
use core::num::NonZeroI32;