Re: [PATCH v2 3/4] rust: alloc: implement `Borrow` and `BorrowMut` for `KBox`

From: Benno Lossin
Date: Sat Jun 14 2025 - 15:21:10 EST


On Fri Jun 13, 2025 at 3:46 PM CEST, Alexandre Courbot wrote:
> Implement `Borrow<T>` and `BorrowMut<T>` for `KBox<T>`. This allows
> `KBox<T>` to be used in generic APIs asking for types implementing those
> traits. `T` and `&mut T` also implement those traits allowing users to
> use either owned, borrowed and heap-owned values.
>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>

With the doc comments fixed as detailed in the other thread:

Reviewed-by: Benno Lossin <lossin@xxxxxxxxxx>

---
Cheers,
Benno

> ---
> rust/kernel/alloc/kbox.rs | 61 +++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 61 insertions(+)