Re: [PATCH] rust: add `ARef::into_raw`

From: Danilo Krummrich
Date: Thu Aug 01 2024 - 11:06:37 EST


On 8/1/24 4:16 PM, Alice Ryhl wrote:
Add a method for `ARef` that is analogous to `Arc::into_raw`. It is the
inverse operation of `ARef::from_raw`, and allows you to convert the
`ARef` back into a raw pointer while retaining ownership of the
refcount.

This new function will be used by [1] for converting the type in an
`ARef` using `ARef::from_raw(ARef::into_raw(me).cast())`. The author has
also needed the same function for other use-cases in the past, but [1]
is the first to go upstream.

Link: https://lore.kernel.org/r/20240801-vma-v3-1-db6c1c0afda9@xxxxxxxxxx [1]
Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>

Reviewed-by: Danilo Krummrich <dakr@xxxxxxxxxx>