Skip to content

Commit 8f77a98

Browse files
authored
Merge pull request #418 from ojeda/deny
Globally deny Clippy and `rust_2018_idioms`
2 parents dcf2391 + b548e03 commit 8f77a98

File tree

7 files changed

+10
-19
lines changed

7 files changed

+10
-19
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,10 @@ KBUILD_RUSTCFLAGS := --emit=dep-info,obj,metadata --edition=2018 \
526526
-Cpanic=abort -Cembed-bitcode=n -Clto=n -Crpath=n \
527527
-Cforce-unwind-tables=n -Ccodegen-units=1 \
528528
-Zbinary_dep_depinfo=y -Zsymbol-mangling-version=v0 \
529-
-Dunsafe_op_in_unsafe_fn -Wmissing_docs
529+
-Dunsafe_op_in_unsafe_fn -Drust_2018_idioms \
530+
-Wmissing_docs
531+
KBUILD_CLIPPYFLAGS := -Dclippy::correctness -Dclippy::style \
532+
-Dclippy::complexity -Dclippy::perf
530533
KBUILD_AFLAGS_KERNEL :=
531534
KBUILD_CFLAGS_KERNEL :=
532535
KBUILD_RUSTCFLAGS_KERNEL :=
@@ -539,7 +542,7 @@ CLANG_FLAGS :=
539542

540543
ifeq ($(KBUILD_CLIPPY),1)
541544
RUSTC_OR_CLIPPY_QUIET := CLIPPY
542-
RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER)
545+
RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER) $(KBUILD_CLIPPYFLAGS)
543546
else
544547
RUSTC_OR_CLIPPY_QUIET := RUSTC
545548
RUSTC_OR_CLIPPY = $(RUSTC)

drivers/android/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl Node {
320320
) {
321321
out.ptr = self.ptr as _;
322322
out.cookie = self.cookie as _;
323-
let inner = self.inner.access(&guard);
323+
let inner = self.inner.access(guard);
324324
if inner.strong.has_count {
325325
out.has_strong_ref = 1;
326326
}

drivers/android/rust_binder.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
77
#![no_std]
88
#![feature(global_asm, try_reserve, allocator_api, concat_idents)]
9+
// TODO: clean these up
10+
#![allow(rust_2018_idioms)]
911

1012
use alloc::{boxed::Box, sync::Arc};
1113
use core::pin::Pin;

drivers/char/hw_random/bcm2835_rng_rust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct RngModule {
7373
impl KernelModule for RngModule {
7474
fn init() -> Result<Self> {
7575
const OF_MATCH_TBL: ConstOfMatchTable<1> =
76-
ConstOfMatchTable::new_const([&c_str!("brcm,bcm2835-rng")]);
76+
ConstOfMatchTable::new_const([c_str!("brcm,bcm2835-rng")]);
7777

7878
let pdev = platdev::Registration::new_pinned::<RngDriver>(
7979
c_str!("bcm2835-rng-rust"),

rust/compiler_builtins.rs

Lines changed: 1 addition & 5 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, )* }) => {
@@ -143,7 +139,7 @@ extern "C" {
143139
}
144140

145141
#[panic_handler]
146-
fn panic(_info: &core::panic::PanicInfo) -> ! {
142+
fn panic(_info: &core::panic::PanicInfo<'_>) -> ! {
147143
unsafe {
148144
rust_helper_BUG();
149145
}

rust/kernel/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +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)]
31-
#![deny(rust_2018_idioms)]
3227

3328
// Ensure conditional compilation based on the kernel configuration works;
3429
// otherwise we may silently break things like initcall handling.

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)