From 8031d8431bd56ef274eb07ab179f1b82a6b858cd Mon Sep 17 00:00:00 2001 From: MichiRecRoom <1008889+LikeLakers2@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:47:10 -0500 Subject: [PATCH] bevy_window: Apply `#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` (#17213) # Objective - https://github.com/bevyengine/bevy/issues/17111 ## Solution Set the `clippy::allow_attributes` and `clippy::allow_attributes_without_reason` lints to `deny`, and bring `bevy_window` in line with the new restrictions. ## Testing `cargo clippy --tests` was run, and no errors were encountered. --- crates/bevy_window/src/lib.rs | 5 +++++ crates/bevy_window/src/raw_handle.rs | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/bevy_window/src/lib.rs b/crates/bevy_window/src/lib.rs index 8ef4cb9c0c7b9..246d7487388f5 100644 --- a/crates/bevy_window/src/lib.rs +++ b/crates/bevy_window/src/lib.rs @@ -1,4 +1,9 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![deny( + clippy::allow_attributes, + clippy::allow_attributes_without_reason, + reason = "See #17111; To be removed once all crates are in-line with these attributes" +)] #![doc( html_logo_url = "https://bevyengine.org/assets/icon.png", html_favicon_url = "https://bevyengine.org/assets/icon.png" diff --git a/crates/bevy_window/src/raw_handle.rs b/crates/bevy_window/src/raw_handle.rs index 6a0b33ae6d752..c416a0f3f1962 100644 --- a/crates/bevy_window/src/raw_handle.rs +++ b/crates/bevy_window/src/raw_handle.rs @@ -1,4 +1,7 @@ -#![allow(unsafe_code)] +#![expect( + unsafe_code, + reason = "This module acts as a wrapper around the `raw_window_handle` crate, which exposes many unsafe interfaces; thus, we have to use unsafe code here." +)] use alloc::sync::Arc; use bevy_ecs::prelude::Component;