Skip to content

Commit 01d62e8

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 ca7d3dc commit 01d62e8

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
@@ -528,6 +528,8 @@ KBUILD_RUSTCFLAGS := --emit=dep-info,obj,metadata --edition=2018 \
528528
-Cforce-unwind-tables=n -Ccodegen-units=1 \
529529
-Zbinary_dep_depinfo=y -Zsymbol-mangling-version=v0 \
530530
-Dunsafe_op_in_unsafe_fn -Wmissing_docs
531+
KBUILD_CLIPPYFLAGS := -Dclippy::correctness -Dclippy::style \
532+
-Dclippy::complexity -Dclippy::perf
531533
KBUILD_AFLAGS_KERNEL :=
532534
KBUILD_CFLAGS_KERNEL :=
533535
KBUILD_RUSTCFLAGS_KERNEL :=
@@ -540,7 +542,7 @@ CLANG_FLAGS :=
540542

541543
ifeq ($(KBUILD_CLIPPY),1)
542544
RUSTC_OR_CLIPPY_QUIET := CLIPPY
543-
RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER)
545+
RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER) $(KBUILD_CLIPPYFLAGS)
544546
else
545547
RUSTC_OR_CLIPPY_QUIET := RUSTC
546548
RUSTC_OR_CLIPPY = $(RUSTC)

rust/compiler_builtins.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
#![compiler_builtins]
2626
#![no_builtins]
2727
#![no_std]
28-
#![deny(clippy::complexity)]
29-
#![deny(clippy::correctness)]
30-
#![deny(clippy::perf)]
31-
#![deny(clippy::style)]
3228

3329
macro_rules! define_panicking_intrinsics(
3430
($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)