Re: [PATCH 00/19] rust: lint improvements

From: Miguel Ojeda
Date: Thu Oct 03 2024 - 17:52:10 EST


On Wed, Sep 4, 2024 at 10:44 PM Miguel Ojeda <ojeda@xxxxxxxxxx> wrote:
>
> Hi all,
>
> This is a series that contains a series of lint-related things:
>
> - Cleanups and other improvements and fixes, including removing `allow`s that
> are not needed anymore for different reasons and a workaround for
> `dbg_macro` detection.
>
> - The enablement of some safety lints so that the toolchain enforces that we
> write `// SAFETY` comments and `# Safety` sections properly.
>
> - The addition of `.clippy.toml`, which allows us to take advantage of a few
> configuration options.
>
> - Start using the new `#[expect(...)]` feature and add documentation on it as
> well as lints in general.
>
> Overall, this should improve the quality of the code and documentation as well
> as reduce the time needed in reviews.
>
> I want to mention Trevor's nice work on lints from a while ago [1]. I think we
> should still do something like that: discuss which lints we would like to have
> one-by-one and start enabling them (and perhaps have a file like Trevor proposed
> etc.).
>
> For the moment, though, I am sending these, since we would like to have at least
> the safety-related ones enabled soon [2]: now that more code and developers
> are joining, it sounds like a good time to start enforcing it -- it should make
> new Rust kernel developers aware of the need of writing them, which has proven
> to be a common request from reviewers.
>
> If needed, the series can be applied partially or split, but most of it should
> be fairly uncontroversial.
>
> Link: https://github.com/Rust-for-Linux/linux/pull/1025 [1]
> Link: https://lore.kernel.org/rust-for-linux/CD29DF8F-7FF3-466F-9724-BC92C14A68BD@xxxxxxxxxxxxx/ [2]

Applied to `rust-next` -- thanks everyone!

Cheers,
Miguel