Re: [PATCH v4 02/22] rust: transmute: add `cast_slice[_mut]` functions
From: Alexandre Courbot
Date: Wed Oct 14 2026 - 11:17:38 EST
On Mon Sep 28, 2026 at 10:11 AM JST, alistair23 wrote:
> From: Benno Lossin <benno.lossin@xxxxxxxxx>
>
> Add functions to make casting slices only one `unsafe` block.
>
> Signed-off-by: Benno Lossin <benno.lossin@xxxxxxxxx>
> Message-ID: <20250814124424.516191-2-lossin@xxxxxxxxxx>
> Signed-off-by: Alistair Francis <alistair.francis@xxxxxxx>
> ---
> rust/kernel/transmute.rs | 71 +++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 70 insertions(+), 1 deletion(-)
`transmute.rs` has been made obsolete by the introduction of `zerocopy`,
so I dont think the timing is right to extend it, especially since the
new methods allow to basically cast any slice into any other without
any constraint. Thankfully I don't think we need this at all: the only
users for these new methods are the `Deref` implementations in patch 3,
and I believe these can be implemented better (I'll comment there).
So basically I think this patch can be dropped entirely.