From 9b156409f729e10a3cbd5da6a0aee600e3ce040d Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Fri, 2 Jul 2021 18:30:27 +0200 Subject: [PATCH] rust: deny Clippy warnings globally This allows to remove the `#[deny(clippy::*)]` lines, and makes catching Clippy issues in the leaf modules. Signed-off-by: Miguel Ojeda --- Makefile | 4 +++- rust/compiler_builtins.rs | 4 ---- rust/kernel/lib.rs | 4 ---- rust/macros/lib.rs | 5 ----- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 8ab454529f064c..a652c8415e460b 100644 --- a/Makefile +++ b/Makefile @@ -527,6 +527,8 @@ KBUILD_RUSTCFLAGS := --emit=dep-info,obj,metadata --edition=2018 \ -Cforce-unwind-tables=n -Ccodegen-units=1 \ -Zbinary_dep_depinfo=y -Zsymbol-mangling-version=v0 \ -Dunsafe_op_in_unsafe_fn -Wmissing_docs +KBUILD_CLIPPYFLAGS := -Dclippy::correctness -Dclippy::style \ + -Dclippy::complexity -Dclippy::perf KBUILD_AFLAGS_KERNEL := KBUILD_CFLAGS_KERNEL := KBUILD_RUSTCFLAGS_KERNEL := @@ -539,7 +541,7 @@ CLANG_FLAGS := ifeq ($(KBUILD_CLIPPY),1) RUSTC_OR_CLIPPY_QUIET := CLIPPY - RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER) + RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER) $(KBUILD_CLIPPYFLAGS) else RUSTC_OR_CLIPPY_QUIET := RUSTC RUSTC_OR_CLIPPY = $(RUSTC) diff --git a/rust/compiler_builtins.rs b/rust/compiler_builtins.rs index d8261c56984097..79e4d887529627 100644 --- a/rust/compiler_builtins.rs +++ b/rust/compiler_builtins.rs @@ -23,10 +23,6 @@ #![compiler_builtins] #![no_builtins] #![no_std] -#![deny(clippy::complexity)] -#![deny(clippy::correctness)] -#![deny(clippy::perf)] -#![deny(clippy::style)] macro_rules! define_panicking_intrinsics( ($reason: tt, { $($ident: ident, )* }) => { diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index 7201cebd7981df..d868f36b49d8d7 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -24,10 +24,6 @@ receiver_trait, try_reserve )] -#![deny(clippy::complexity)] -#![deny(clippy::correctness)] -#![deny(clippy::perf)] -#![deny(clippy::style)] #![deny(rust_2018_idioms)] // Ensure conditional compilation based on the kernel configuration works; diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs index fe39e5995f3600..cb7a4f12f3b4dc 100644 --- a/rust/macros/lib.rs +++ b/rust/macros/lib.rs @@ -2,11 +2,6 @@ //! Crate for all kernel procedural macros. -#![deny(clippy::complexity)] -#![deny(clippy::correctness)] -#![deny(clippy::perf)] -#![deny(clippy::style)] - mod module; use proc_macro::TokenStream;