From afc2af8581fc1d85b6fa2d857f554fb404631d29 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 31 Jul 2024 11:07:08 +0200 Subject: [PATCH 1/3] uefi: streamline lints This is okay as we have those as listed under `deny` in `uefi-raw` as well and we have "-D warnings" in CI anyway (ignoring the temporary workaround --- uefi/src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/uefi/src/lib.rs b/uefi/src/lib.rs index 679990d5a..4d2825b8b 100644 --- a/uefi/src/lib.rs +++ b/uefi/src/lib.rs @@ -87,15 +87,16 @@ #![cfg_attr(all(feature = "unstable", feature = "alloc"), feature(allocator_api))] #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![no_std] -// Enable some additional warnings and lints. -#![warn(clippy::ptr_as_ptr, missing_docs, unused)] #![deny( clippy::all, + clippy::missing_const_for_fn, clippy::must_use_candidate, + clippy::ptr_as_ptr, clippy::use_self, - clippy::missing_const_for_fn + missing_debug_implementations, + missing_docs, + unused )] -#![deny(missing_debug_implementations)] #[cfg(feature = "alloc")] extern crate alloc; From cedcce9e65a7f786c7486db1f419d008d7593e89 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 31 Jul 2024 11:11:32 +0200 Subject: [PATCH 2/3] uefi: workaround dead code warning on nightly This is a more fine-grained approach than taken in 716f9bc3bd253e697d8ad880a4a0661f0c68fae1. --- uefi/src/proto/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uefi/src/proto/mod.rs b/uefi/src/proto/mod.rs index 5919b7afc..1650fb983 100644 --- a/uefi/src/proto/mod.rs +++ b/uefi/src/proto/mod.rs @@ -9,6 +9,8 @@ //! //! [`BootServices`]: crate::table::boot::BootServices#accessing-protocols +#![warn(dead_code)] // https://github.com/rust-osdev/uefi-rs/issues/1205 + use crate::Identify; use core::ffi::c_void; From 071db396592bfcabe8a5a19463e9667990a6edbd Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 31 Jul 2024 11:19:17 +0200 Subject: [PATCH 3/3] uefi: fix unused `use` --- uefi/src/proto/tcg/v1.rs | 2 +- uefi/src/proto/tcg/v2.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/uefi/src/proto/tcg/v1.rs b/uefi/src/proto/tcg/v1.rs index 30173b7a3..40ddf6731 100644 --- a/uefi/src/proto/tcg/v1.rs +++ b/uefi/src/proto/tcg/v1.rs @@ -22,7 +22,7 @@ use ptr_meta::Pointee; use {crate::mem::make_boxed, alloc::boxed::Box}; #[cfg(all(feature = "unstable", feature = "alloc"))] -use {alloc::alloc::Global, core::alloc::Allocator}; +use alloc::alloc::Global; /// 20-byte SHA-1 digest. pub type Sha1Digest = [u8; 20]; diff --git a/uefi/src/proto/tcg/v2.rs b/uefi/src/proto/tcg/v2.rs index 987a6cd49..ba9b98fdd 100644 --- a/uefi/src/proto/tcg/v2.rs +++ b/uefi/src/proto/tcg/v2.rs @@ -25,7 +25,7 @@ use ptr_meta::{Pointee, PtrExt}; use {crate::mem::make_boxed, alloc::boxed::Box}; #[cfg(all(feature = "unstable", feature = "alloc"))] -use {alloc::alloc::Global, core::alloc::Allocator}; +use alloc::alloc::Global; /// Version information. ///