Re: [PATCH] rust: delete `ForeignOwnable::borrow_mut`

From: Martin Rodriguez Reboredo
Date: Thu Jul 06 2023 - 20:03:24 EST


On 7/6/23 06:46, Alice Ryhl 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>
---
[...]

Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@xxxxxxxxx>