diff --git a/Makefile b/Makefile index a652c8415e460b..e27f2e96d9a6a6 100644 --- a/Makefile +++ b/Makefile @@ -526,7 +526,8 @@ KBUILD_RUSTCFLAGS := --emit=dep-info,obj,metadata --edition=2018 \ -Cpanic=abort -Cembed-bitcode=n -Clto=n -Crpath=n \ -Cforce-unwind-tables=n -Ccodegen-units=1 \ -Zbinary_dep_depinfo=y -Zsymbol-mangling-version=v0 \ - -Dunsafe_op_in_unsafe_fn -Wmissing_docs + -Dunsafe_op_in_unsafe_fn -Drust_2018_idioms \ + -Wmissing_docs KBUILD_CLIPPYFLAGS := -Dclippy::correctness -Dclippy::style \ -Dclippy::complexity -Dclippy::perf KBUILD_AFLAGS_KERNEL := diff --git a/drivers/android/rust_binder.rs b/drivers/android/rust_binder.rs index 8f457913154afe..c39c081af574de 100644 --- a/drivers/android/rust_binder.rs +++ b/drivers/android/rust_binder.rs @@ -6,6 +6,8 @@ #![no_std] #![feature(global_asm, try_reserve, allocator_api, concat_idents)] +// TODO: clean these up +#![allow(rust_2018_idioms)] use alloc::{boxed::Box, sync::Arc}; use core::pin::Pin; diff --git a/rust/compiler_builtins.rs b/rust/compiler_builtins.rs index 79e4d887529627..cb4bbf7be4e313 100644 --- a/rust/compiler_builtins.rs +++ b/rust/compiler_builtins.rs @@ -139,7 +139,7 @@ extern "C" { } #[panic_handler] -fn panic(_info: &core::panic::PanicInfo) -> ! { +fn panic(_info: &core::panic::PanicInfo<'_>) -> ! { unsafe { rust_helper_BUG(); } diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index d868f36b49d8d7..65643d061db579 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -24,7 +24,6 @@ receiver_trait, try_reserve )] -#![deny(rust_2018_idioms)] // Ensure conditional compilation based on the kernel configuration works; // otherwise we may silently break things like initcall handling.