Re: [PATCH 2/6] rust: binder: transmute transaction data

From: Tamir Duberstein

Date: Tue May 26 2026 - 14:08:04 EST


On Tue, May 26, 2026 at 1:47 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Tue, May 26, 2026 at 6:31 PM Tamir Duberstein <tamird@xxxxxxxxxx> wrote:
> >
> > Thanks for explaining. There is already a clippy lint for this, which
> > I'm looking into enabling.
>
> Would it make sense to add a custom, narrower function to perform such
> casts? i.e. to still avoid `as` and to make it greppable.

It is possible to do these conversions through pointer casts that
avoid `as` so we don't need a function with an `#[allow]`. The
greppable function you're after here is basically
https://github.com/rust-lang/project-safe-transmute.