Re: [PATCH] rust: delete `ForeignOwnable::borrow_mut`
From: Miguel Ojeda
Date: Wed Aug 02 2023 - 13:38:37 EST
On Thu, Jul 6, 2023 at 11:46 AM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> We discovered that the current design of `borrow_mut` is problematic.
> This patch removes it until a better solution can be found.
>
> Specifically, the current design gives you access to a `&mut T`, which
> lets you change where the `ForeignOwnable` points (e.g., with
> `core::mem::swap`). No upcoming user of this API intended to make that
> possible, making all of them unsound.
>
> Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
Applied to `rust-fixes`, thanks! I added a `Fixes` tag.
Cheers,
Miguel