Skip to content

rust: add kunit doctest with doc fixes

Jimmy Ostler lkml rust-for-linux 2 versions – Applied

Status from this message: Applied to `rust-next` -- thanks everyone!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 1 replyApplied
  2. v33 patches 5 repliesSuperseded

v2 -> v3 from the cover letter

- Remove From implementation on core::alloc::LayoutError
- Move changes to "rust/kernel/alloc/layout.rs" to separate patch
- Move changes to "rust/kernel/error.rs" to separate patch
- Change documentation in "rust/kernel/init.rs"
- Link [v2]: https://lore.kernel.org/lkml/[email protected]/

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/3rust: error: Change `LayoutError` to internalrust/kernel/error.rs+4 -30 replies
2/3rust: error: Update 'stack_try_pin_init' examplerust/kernel/init.rs+18 -40 replies
3/3rust: alloc: Add doctest for `ArrayLayout`rust/kernel/alloc/layout.rs+19 -00 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchDanilo Krummrich
1/3A-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] rust: add kunit doctest with doc fixes

This patch series adds a doctest for the ArrayLayout type, as well as implements From<LayoutError> for Error for the internal LayoutError. This change in the first patch is required for the added rustdoc kunit test in the third patch to compile.

This series also adds a change to the stack_try_pin_init example documentation, so it correctly imports the AllocError kernel type.

---
v3 -> v4: Reword patch one message for clarity
v2 -> v3:
- Remove From implementation on core::alloc::LayoutError
- Move changes to "rust/kernel/alloc/layout.rs" to separate patch
- Move changes to "rust/kernel/error.rs" to separate patch
- Change documentation in "rust/kernel/init.rs"
- Link [v2]: https://lore.kernel.org/lkml/[email protected]/

v1 -> v2 changes:
- Add third assert where length is smaller but still overflows
- Remove rustdoc markdown codeblock languge signifier
- Change tests to return results using ? instead of panic
- Remove #[derive(Debug)] for LayoutError
- Add From<LayoutError> for Error implementation
- Link [v1]: https://lore.kernel.org/lkml/[email protected]/

Jimmy Ostler (3):
rust: error: Change LayoutError to internal
rust: error: Update 'stack_try_pin_init' example
rust: alloc: Add doctest for ArrayLayout

 rust/kernel/alloc/layout.rs | 19 +++++++++++++++++++
 rust/kernel/error.rs        |  7 ++++---
 rust/kernel/init.rs         | 22 ++++++++++++++++++----
 3 files changed, 41 insertions(+), 7 deletions(-)

base-commit: 0c5928deada15a8d075516e6e0d9ee19011bb000

Signature · 1 line
2.47.1