Skip to content

Commit 9b15640

Browse files
committed
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 <[email protected]>
1 parent 349b967 commit 9b15640

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@ KBUILD_RUSTCFLAGS := --emit=dep-info,obj,metadata --edition=2018 \
527527
-Cforce-unwind-tables=n -Ccodegen-units=1 \
528528
-Zbinary_dep_depinfo=y -Zsymbol-mangling-version=v0 \
529529
-Dunsafe_op_in_unsafe_fn -Wmissing_docs
530+
KBUILD_CLIPPYFLAGS := -Dclippy::correctness -Dclippy::style \
531+
-Dclippy::complexity -Dclippy::perf
530532
KBUILD_AFLAGS_KERNEL :=
531533
KBUILD_CFLAGS_KERNEL :=
532534
KBUILD_RUSTCFLAGS_KERNEL :=
@@ -539,7 +541,7 @@ CLANG_FLAGS :=
539541

540542
ifeq ($(KBUILD_CLIPPY),1)
541543
RUSTC_OR_CLIPPY_QUIET := CLIPPY
542-
RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER)
544+
RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER) $(KBUILD_CLIPPYFLAGS)
543545
else
544546
RUSTC_OR_CLIPPY_QUIET := RUSTC
545547
RUSTC_OR_CLIPPY = $(RUSTC)

rust/compiler_builtins.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
#![compiler_builtins]
2424
#![no_builtins]
2525
#![no_std]
26-
#![deny(clippy::complexity)]
27-
#![deny(clippy::correctness)]
28-
#![deny(clippy::perf)]
29-
#![deny(clippy::style)]
3026

3127
macro_rules! define_panicking_intrinsics(
3228
($reason: tt, { $($ident: ident, )* }) => {

rust/kernel/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
receiver_trait,
2525
try_reserve
2626
)]
27-
#![deny(clippy::complexity)]
28-
#![deny(clippy::correctness)]
29-
#![deny(clippy::perf)]
30-
#![deny(clippy::style)]
3127
#![deny(rust_2018_idioms)]
3228

3329
// Ensure conditional compilation based on the kernel configuration works;

rust/macros/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
//! Crate for all kernel procedural macros.
44
5-
#![deny(clippy::complexity)]
6-
#![deny(clippy::correctness)]
7-
#![deny(clippy::perf)]
8-
#![deny(clippy::style)]
9-
105
mod module;
116

127
use proc_macro::TokenStream;

0 commit comments

Comments
 (0)