rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] rust: add kunit doctest with doc fixes
@ 2024-12-18  0:23 Jimmy Ostler
  2024-12-18  0:23 ` [PATCH v3 1/3] rust: error: Change `LayoutError` to internal Jimmy Ostler
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jimmy Ostler @ 2024-12-18  0:23 UTC (permalink / raw)
  To: Danilo Krummrich, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Wedson Almeida Filho, Filipe Xavier, Valentin Obst,
	Daniel Sedlak, Alex Mantel
  Cc: rust-for-linux, linux-kernel, Jimmy Ostler

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.

Link: https://lore.kernel.org/lkml/20241203051843.291729-1-jtostler1@gmail.com/ [v1]
Link: https://lore.kernel.org/lkml/20241205105627.992587-1-jtostler1@gmail.com/ [v2]
Signed-off-by: Jimmy Ostler <jtostler1@gmail.com>
---
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/20241205105627.992587-1-jtostler1@gmail.com/

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/20241203051843.291729-1-jtostler1@gmail.com/

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: 9a02cbc5139e668f8b74e75a611d3a04b5241228
-- 
2.47.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-12-20  6:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18  0:23 [PATCH v3 0/3] rust: add kunit doctest with doc fixes Jimmy Ostler
2024-12-18  0:23 ` [PATCH v3 1/3] rust: error: Change `LayoutError` to internal Jimmy Ostler
2024-12-18  0:57   ` Miguel Ojeda
2024-12-18 12:43     ` Danilo Krummrich
2024-12-20  6:15       ` Jimmy Ostler
2024-12-18  0:23 ` [PATCH v3 2/3] rust: error: Update 'stack_try_pin_init' example Jimmy Ostler
2024-12-18 12:48   ` Danilo Krummrich
2024-12-18  0:23 ` [PATCH v3 3/3] rust: alloc: Add doctest for `ArrayLayout` Jimmy Ostler
2024-12-18 12:48   ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).