Change documentation imports to use `kernel::alloc::AllocError`,
because `KBox::new()` now returns that, instead of the 'core'
`AllocError`.
Signed-off-by: Jimmy Ostler <jtostler1@gmail.com>
---
rust/kernel/init.rs | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs
index 347049df556b..3d099908dbd5 100644
--- a/rust/kernel/init.rs
+++ b/rust/kernel/init.rs
@@ -290,9 +290,16 @@ macro_rules! stack_pin_init {
///
/// ```rust,ignore
/// # #![expect(clippy::disallowed_names)]
-/// # use kernel::{init, pin_init, stack_try_pin_init, init::*, sync::Mutex, new_mutex};
+/// # use kernel::{init,
+/// # pin_init,
+/// # stack_try_pin_init,
+/// # init::*,
+/// # sync::Mutex,
+/// # new_mutex,
+/// # alloc::AllocError
+/// # };
/// # use macros::pin_data;
-/// # use core::{alloc::AllocError, pin::Pin};
+/// # use core::pin::Pin;
/// #[pin_data]
/// struct Foo {
/// #[pin]
@@ -316,9 +323,16 @@ macro_rules! stack_pin_init {
///
/// ```rust,ignore
/// # #![expect(clippy::disallowed_names)]
-/// # use kernel::{init, pin_init, stack_try_pin_init, init::*, sync::Mutex, new_mutex};
+/// # use kernel::{init,
+/// # pin_init,
+/// # stack_try_pin_init,
+/// # init::*,
+/// # sync::Mutex,
+/// # new_mutex,
+/// # alloc::AllocError
+/// # };
/// # use macros::pin_data;
-/// # use core::{alloc::AllocError, pin::Pin};
+/// # use core::pin::Pin;
/// #[pin_data]
/// struct Foo {
/// #[pin]
--
2.47.1
On Tue, Dec 17, 2024 at 04:23:11PM -0800, Jimmy Ostler wrote:
> Change documentation imports to use `kernel::alloc::AllocError`,
> because `KBox::new()` now returns that, instead of the 'core'
> `AllocError`.
>
> Signed-off-by: Jimmy Ostler <jtostler1@gmail.com>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
> ---
> rust/kernel/init.rs | 22 ++++++++++++++++++----
> 1 file changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs
> index 347049df556b..3d099908dbd5 100644
> --- a/rust/kernel/init.rs
> +++ b/rust/kernel/init.rs
> @@ -290,9 +290,16 @@ macro_rules! stack_pin_init {
> ///
> /// ```rust,ignore
> /// # #![expect(clippy::disallowed_names)]
> -/// # use kernel::{init, pin_init, stack_try_pin_init, init::*, sync::Mutex, new_mutex};
> +/// # use kernel::{init,
> +/// # pin_init,
> +/// # stack_try_pin_init,
> +/// # init::*,
> +/// # sync::Mutex,
> +/// # new_mutex,
> +/// # alloc::AllocError
> +/// # };
> /// # use macros::pin_data;
> -/// # use core::{alloc::AllocError, pin::Pin};
> +/// # use core::pin::Pin;
> /// #[pin_data]
> /// struct Foo {
> /// #[pin]
> @@ -316,9 +323,16 @@ macro_rules! stack_pin_init {
> ///
> /// ```rust,ignore
> /// # #![expect(clippy::disallowed_names)]
> -/// # use kernel::{init, pin_init, stack_try_pin_init, init::*, sync::Mutex, new_mutex};
> +/// # use kernel::{init,
> +/// # pin_init,
> +/// # stack_try_pin_init,
> +/// # init::*,
> +/// # sync::Mutex,
> +/// # new_mutex,
> +/// # alloc::AllocError
> +/// # };
> /// # use macros::pin_data;
> -/// # use core::{alloc::AllocError, pin::Pin};
> +/// # use core::pin::Pin;
> /// #[pin_data]
> /// struct Foo {
> /// #[pin]
> --
> 2.47.1
>
© 2016 - 2025 Red Hat, Inc.