Re: [PATCH v5 0/6] rust: reduce pointer casts, enable related lints
From: Benno Lossin
Date: Mon Mar 24 2025 - 17:40:40 EST
On Mon Mar 24, 2025 at 10:16 PM CET, Tamir Duberstein wrote:
> 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?
One option is to pick the patches early in the cycle and then ask
authors of patches to rebase. We did that with the alloc changes in the
past.
---
Cheers,
Benno