Re: [PATCH v5 0/6] rust: reduce pointer casts, enable related lints

From: Tamir Duberstein
Date: Mon Mar 24 2025 - 17:21:48 EST


On Mon, Mar 24, 2025 at 4:55 PM Tamir Duberstein <tamird@xxxxxxxxx> wrote:
>
> On Mon, Mar 24, 2025 at 4:16 PM Benno Lossin <benno.lossin@xxxxxxxxx> wrote:
> >
> > On Mon Mar 17, 2025 at 3:23 PM CET, Tamir Duberstein wrote:
> > > This started with a patch that enabled `clippy::ptr_as_ptr`. Benno
> > > Lossin suggested I also look into `clippy::ptr_cast_constness` and I
> > > discovered `clippy::as_ptr_cast_mut`. This series now enables all 3
> > > lints. It also enables `clippy::as_underscore` which ensures other
> > > pointer casts weren't missed. The first commit reduces the need for
> > > pointer casts and is shared with another series[1].
> > >
> > > The final patch also enables pointer provenance lints and fixes
> > > violations. See that commit message for details. The build system
> > > portion of that commit is pretty messy but I couldn't find a better way
> > > to convincingly ensure that these lints were applied globally.
> > > Suggestions would be very welcome.
> >
> > I applied the patches to v6.14-rc7 and did a quick pass with

So I rebased this on rust-next and fixed a few more instances (in
addition to enabling the extra lint), but I realized that rust-next is
still based on v6.14-rc5. I think we're going to have the same problem
here as in the &raw series; either Miguel is going to have to apply
fixups when picking these patches, or we have to split the fixes out
from the lints and land it over several cycles. Thoughts?