Skip to content

Commit aeeda47

Browse files
LordGoatiusjannau
authored andcommitted
rust: init: update stack_try_pin_init examples
Change documentation imports to use `kernel::alloc::AllocError`, because `KBox::new()` now returns that, instead of the `core`'s `AllocError`. Reviewed-by: Danilo Krummrich <[email protected]> Signed-off-by: Jimmy Ostler <[email protected]> Link: https://lore.kernel.org/r/ec8badbe94c5e78f22315325a7f2ae96129d6a65.1734674670.git.jtostler1@gmail.com [ Fixed formatting of imports (still unordered). Slightly reworded commit. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent e951853 commit aeeda47

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

rust/kernel/init.rs

+20-4
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,17 @@ macro_rules! stack_pin_init {
290290
///
291291
/// ```rust,ignore
292292
/// # #![expect(clippy::disallowed_names)]
293-
/// # use kernel::{init, pin_init, stack_try_pin_init, init::*, sync::Mutex, new_mutex};
293+
/// # use kernel::{
294+
/// # init,
295+
/// # pin_init,
296+
/// # stack_try_pin_init,
297+
/// # init::*,
298+
/// # sync::Mutex,
299+
/// # new_mutex,
300+
/// # alloc::AllocError,
301+
/// # };
294302
/// # use macros::pin_data;
295-
/// # use core::{alloc::AllocError, pin::Pin};
303+
/// # use core::pin::Pin;
296304
/// #[pin_data]
297305
/// struct Foo {
298306
/// #[pin]
@@ -316,9 +324,17 @@ macro_rules! stack_pin_init {
316324
///
317325
/// ```rust,ignore
318326
/// # #![expect(clippy::disallowed_names)]
319-
/// # use kernel::{init, pin_init, stack_try_pin_init, init::*, sync::Mutex, new_mutex};
327+
/// # use kernel::{
328+
/// # init,
329+
/// # pin_init,
330+
/// # stack_try_pin_init,
331+
/// # init::*,
332+
/// # sync::Mutex,
333+
/// # new_mutex,
334+
/// # alloc::AllocError,
335+
/// # };
320336
/// # use macros::pin_data;
321-
/// # use core::{alloc::AllocError, pin::Pin};
337+
/// # use core::pin::Pin;
322338
/// #[pin_data]
323339
/// struct Foo {
324340
/// #[pin]

0 commit comments

Comments
 (0)