Re: [PATCH v2] rust: add `ARef::into_raw`
From: Miguel Ojeda
Date: Sun Aug 25 2024 - 08:50:57 EST
On Wed, Aug 21, 2024 at 9:59 PM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> From: Kartik Prajapati <kartikprajapati987@xxxxxxxxx>
>
> 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.
>
> This was implemented independently by Kartik and Alice. The two versions
> were merged by Alice, so all mistakes are Alice's.
>
> Link: https://lore.kernel.org/r/20240801-vma-v3-1-db6c1c0afda9@xxxxxxxxxx [1]
> Closes: https://github.com/Rust-for-Linux/linux/issues/1044
> Signed-off-by: Kartik Prajapati <kartikprajapati987@xxxxxxxxx>
> Co-developed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
Applied to `rust-next` -- thanks everyone!
[ Reworded to correct the author reference and changed tag to Link
since it is not a bug. - Miguel ]
Cheers,
Miguel