Skip to content

Commit

Permalink
rust: deny Clippy warnings globally
Browse files Browse the repository at this point in the history
This allows to remove the `#[deny(clippy::*)]` lines,
and makes catching Clippy issues in the leaf modules.

Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
ojeda committed Jul 2, 2021
1 parent 349b967 commit 9b15640
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 :=
Expand All @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions rust/compiler_builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, )* }) => {
Expand Down
4 changes: 0 additions & 4 deletions rust/kernel/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions rust/macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9b15640

Please sign in to comment.