Re: [PATCH v4 1/2] rust: kernel: add `drop_contents` to `BoxExt`

From: Miguel Ojeda
Date: Wed Aug 21 2024 - 18:17:01 EST


On Mon, Aug 19, 2024 at 1:24 PM Benno Lossin <benno.lossin@xxxxxxxxx> wrote:
>
> Sometimes (see [1]) it is necessary to drop the value inside of a
> `Box<T>`, but retain the allocation. For example to reuse the allocation
> in the future.
> Introduce a new function `drop_contents` that turns a `Box<T>` into
> `Box<MaybeUninit<T>>` by dropping the value.
>
> Signed-off-by: Benno Lossin <benno.lossin@xxxxxxxxx>
> Link: https://lore.kernel.org/rust-for-linux/20240418-b4-rbtree-v3-5-323e134390ce@xxxxxxxxxx/ [1]

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

Cheers,
Miguel