]> www.infradead.org Git - users/dwmw2/linux.git/commit
rust: relax most deny-level lints to warnings
authorMiguel Ojeda <ojeda@kernel.org>
Tue, 9 Jul 2024 16:05:59 +0000 (18:05 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Wed, 10 Jul 2024 08:28:51 +0000 (10:28 +0200)
commitf8f88aa25a03ce1e0fc8a9842840988b870f0c37
treea13ec2604037f7d425f76569d1e133fcc5ff13cc
parentf85bea18f71b2817ea45d63c6d1b91f9bc4a811f
rust: relax most deny-level lints to warnings

Since we are starting to support several Rust toolchains, lints (including
Clippy ones) now may behave differently and lint groups may include
new lints.

Therefore, to maximize the chances a given version works, relax some
deny-level lints to warnings. It may also make our lives a bit easier
while developing new code or refactoring.

To be clear, the requirements for in-tree code are still the same, since
Rust code still needs to be warning-free (patches should be clean under
`WERROR=y`) and the set of lints is not changed.

`unsafe_op_in_unsafe_fn` is left unmodified, i.e. as an error, since it is
becoming the default in the language (warn-by-default in Rust 2024 [1] and
ideally an error later on) and thus it should also be very well tested. In
addition, it is simple enough that it should not have false positives
(unlike e.g. `rust_2018_idioms`'s `explicit_outlives_requirements`).

`non_ascii_idents` is left unmodified as well, i.e. as an error, since
it is unlikely one gains any productivity during development if it
were a warning (in fact, it may be worse, since it is likely one made
a typo). In addition, it should not have false positives.

Finally, put the two `-D` ones at the top and take the chance to do one
per line.

Link: https://github.com/rust-lang/rust/pull/112038
Reviewed-by: Finn Behrens <me@kloenk.dev>
Tested-by: Benno Lossin <benno.lossin@proton.me>
Tested-by: Andreas Hindborg <a.hindborg@samsung.com>
Link: https://lore.kernel.org/r/20240709160615.998336-5-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Makefile
rust/Makefile