Re: [PATCH v2 2/6] rust: types: avoid `as` casts

From: Miguel Ojeda
Date: Fri Nov 08 2024 - 08:15:08 EST


On Fri, Nov 8, 2024 at 12:35 PM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> The compiler auto-converts from *mut to *const, so only cast_mut() is
> necessary. I think this will still compile if you get rid of all of
> the cast_const() calls.

Yeah, if there was a mode/lint that forced us to avoid the coercion,
then I guess this could eventually make sense as a more explicit (and
symmetric) style around raw pointers -- I opened:

https://github.com/rust-lang/rust-clippy/issues/13667

to see what others think.

Cheers,
Miguel