summaryrefslogtreecommitdiff
path: root/rust/kernel/error.rs
diff options
context:
space:
mode:
authorJimmy Ostler <jtostler1@gmail.com>2024-12-20 09:25:31 +0300
committerMiguel Ojeda <ojeda@kernel.org>2025-01-14 01:45:13 +0300
commit7871c612cade8943694cc254740a374e3fb42a7c (patch)
tree726f86bc23fc12a4dfae8f5d24025886554f82cd /rust/kernel/error.rs
parentb6357e26865a25650e49c4eb5abe6ef57ae4ede1 (diff)
downloadlinux-7871c612cade8943694cc254740a374e3fb42a7c.tar.xz
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>
Diffstat (limited to 'rust/kernel/error.rs')
-rw-r--r--rust/kernel/error.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
index 914e8dec1abd..f6ecf09cb65f 100644
--- a/rust/kernel/error.rs
+++ b/rust/kernel/error.rs
@@ -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;