Re: [PATCH v4 2/7] rust: sync: implement `Borrow` and `BorrowMut` for `Arc` types

From: Miguel Ojeda
Date: Sun Jun 29 2025 - 15:32:12 EST


On Mon, Jun 16, 2025 at 5:34 AM Alexandre Courbot <acourbot@xxxxxxxxxx> 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>
> Reviewed-by: Benno Lossin <lossin@xxxxxxxxxx>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>

Applied to `rust-next` -- thanks everyone!

Cheers,
Miguel