[PATCH v2 0/3] replace `allow(...)` lints with `expect(...)`

Onur Özkan posted 3 patches 3 months, 1 week ago
There is a newer version of this series
drivers/gpu/nova-core/regs.rs       | 2 +-
rust/compiler_builtins.rs           | 2 +-
rust/kernel/alloc/allocator_test.rs | 2 +-
rust/kernel/cpufreq.rs              | 1 -
rust/kernel/devres.rs               | 2 +-
rust/kernel/driver.rs               | 2 +-
rust/kernel/drm/ioctl.rs            | 8 ++++----
rust/kernel/error.rs                | 3 +--
rust/kernel/init.rs                 | 6 +++---
rust/kernel/kunit.rs                | 2 +-
rust/kernel/opp.rs                  | 4 ++--
rust/kernel/types.rs                | 2 +-
rust/macros/helpers.rs              | 2 +-
13 files changed, 18 insertions(+), 20 deletions(-)
[PATCH v2 0/3] replace `allow(...)` lints with `expect(...)`
Posted by Onur Özkan 3 months, 1 week ago
Changes in v2:
  - Removed lints are not replaced with `expect` in the first diff.
  - Removals are done in separate diffs for each.

The `#[allow(clippy::non_send_fields_in_send_ty)]` removal was tested
on 1.81 and clippy was still happy with it. I couldn't test it on 1.78
because when I go below 1.81 `menuconfig` no longer shows the Rust option.
And any manual changes I make to `.config` are immediately reverted on
`make` invocations.

Onur Özkan (3):
  replace `#[allow(...)]` with `#[expect(...)]`
  rust: remove `#[allow(clippy::unnecessary_cast)]`
  rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`

 drivers/gpu/nova-core/regs.rs       | 2 +-
 rust/compiler_builtins.rs           | 2 +-
 rust/kernel/alloc/allocator_test.rs | 2 +-
 rust/kernel/cpufreq.rs              | 1 -
 rust/kernel/devres.rs               | 2 +-
 rust/kernel/driver.rs               | 2 +-
 rust/kernel/drm/ioctl.rs            | 8 ++++----
 rust/kernel/error.rs                | 3 +--
 rust/kernel/init.rs                 | 6 +++---
 rust/kernel/kunit.rs                | 2 +-
 rust/kernel/opp.rs                  | 4 ++--
 rust/kernel/types.rs                | 2 +-
 rust/macros/helpers.rs              | 2 +-
 13 files changed, 18 insertions(+), 20 deletions(-)

--
2.50.0

Re: [PATCH v2 0/3] replace `allow(...)` lints with `expect(...)`
Posted by Miguel Ojeda 3 months, 1 week ago
On Fri, Jun 27, 2025 at 8:54 AM Onur Özkan <work@onurozkan.dev> wrote:
>
> The `#[allow(clippy::non_send_fields_in_send_ty)]` removal was tested
> on 1.81 and clippy was still happy with it. I couldn't test it on 1.78
> because when I go below 1.81 `menuconfig` no longer shows the Rust option.
> And any manual changes I make to `.config` are immediately reverted on
> `make` invocations.

For that, I recommend using the `/` command inside `menuconfig` -- it
allows you to see the dependencies of a given symbol, and whether they
are met or not. That way, it allows one to understand what else may be
missing to enable a symbol.

I hope that helps.

Cheers,
Miguel
Re: [PATCH v2 0/3] replace `allow(...)` lints with `expect(...)`
Posted by Onur 3 months, 1 week ago
On Fri, 27 Jun 2025 17:55:41 +0200
Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:

> On Fri, Jun 27, 2025 at 8:54 AM Onur Özkan <work@onurozkan.dev> wrote:
> >
> > The `#[allow(clippy::non_send_fields_in_send_ty)]` removal was
> > tested on 1.81 and clippy was still happy with it. I couldn't test
> > it on 1.78 because when I go below 1.81 `menuconfig` no longer
> > shows the Rust option. And any manual changes I make to `.config`
> > are immediately reverted on `make` invocations.
> 
> For that, I recommend using the `/` command inside `menuconfig` -- it
> allows you to see the dependencies of a given symbol, and whether they
> are met or not. That way, it allows one to understand what else may be
> missing to enable a symbol.
> 
> I hope that helps.
> 
> Cheers,
> Miguel

I already tried that but it didn't helped. I was able to make it work
with manually hacking the `init/Kconfig` file.

Removal of `#[allow(clippy::non_send_fields_in_send_ty)]` still works
as expected, but using `#![expect(internal_features)]` (which was done
in the first diff) doesn't work on 1.78. I will revert that and send v3
patch in a short.


Regards,
Onur
Re: [PATCH v2 0/3] replace `allow(...)` lints with `expect(...)`
Posted by Miguel Ojeda 3 months, 1 week ago
On Sat, Jun 28, 2025 at 6:03 AM Onur <work@onurozkan.dev> wrote:
>
> I already tried that but it didn't helped. I was able to make it work
> with manually hacking the `init/Kconfig` file.

That should not be needed -- the `/` command should tell you what you
are missing.

Cheers,
Miguel