]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: allow globally `clippy::incompatible_msrv`
authorMiguel Ojeda <ojeda@kernel.org>
Sun, 5 Apr 2026 23:52:43 +0000 (01:52 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 7 Apr 2026 07:54:57 +0000 (09:54 +0200)
`clippy::incompatible_msrv` is not buying us much, and we discussed
allowing it several times in the past.

For instance, there was recently another patch sent to `allow` it where
needed [1]. While that particular case would not be needed after the
minimum version bump to 1.85.0, it is simpler to just allow it to prevent
future instances.

[ In addition, the lint fired without taking into account the features
  that have been enabled in a crate [2]. While this was improved in Rust
  1.90.0 [3], it would still fire in a case like this patch. ]

Thus do so, and remove the last instance of locally allowing it we have
in the tree (except the one in the vendored `proc_macro2` crate).

Note that we still keep the `msrv` config option in `clippy.toml` since
that affects other lints as well.

Link: https://lore.kernel.org/rust-for-linux/20260404212831.78971-4-jhubbard@nvidia.com/
Link: https://github.com/rust-lang/rust-clippy/issues/14425
Link: https://github.com/rust-lang/rust-clippy/pull/14433
Link: https://patch.msgid.link/20260405235309.418950-8-ojeda@kernel.org
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Tamir Duberstein <tamird@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Makefile
rust/macros/helpers.rs

index a63684c36d60f491d337169fa7de88faa2f0a6a8..78f5ee173edad522da13153f65e2e51405c28f20 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -486,6 +486,7 @@ export rust_common_flags := --edition=2021 \
                            -Wclippy::as_underscore \
                            -Wclippy::cast_lossless \
                            -Wclippy::ignored_unit_patterns \
+                           -Aclippy::incompatible_msrv \
                            -Wclippy::mut_mut \
                            -Wclippy::needless_bitwise_bool \
                            -Aclippy::needless_lifetimes \
index 37ef6a6f2c851ecfe9e83b62c7b6f497a3ad22dd..d18fbf4daa0a5f461065147c92d6d0a2bf9e0daf 100644 (file)
@@ -49,7 +49,6 @@ pub(crate) fn file() -> String {
     }
 
     #[cfg(CONFIG_RUSTC_HAS_SPAN_FILE)]
-    #[allow(clippy::incompatible_msrv)]
     {
         proc_macro::Span::call_site().file()
     }