Re: [PATCH v2 2/4] rust: sync: implement `Borrow` and `BorrowMut` for `Arc` types
From: Benno Lossin
Date: Sat Jun 14 2025 - 15:20:56 EST
On Fri Jun 13, 2025 at 3:46 PM CEST, Alexandre Courbot wrote:
> Implement `Borrow<T>` and `BorrowMut<T>` for `UniqueArc<T>`, and
> `Borrow<T>` for `Arc<T>`. This allows these containers 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,
> shared or borrowed values.
>
> `ForeignOwnable` makes a call to its own `borrow` method which must be
> disambiguated.
>
> 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/sync/arc.rs | 84 ++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 83 insertions(+), 1 deletion(-)