diff --git a/crates/bevy_asset/src/asset_changed.rs b/crates/bevy_asset/src/asset_changed.rs index b8f3fafc6bb88..48a099cbee4a3 100644 --- a/crates/bevy_asset/src/asset_changed.rs +++ b/crates/bevy_asset/src/asset_changed.rs @@ -148,7 +148,7 @@ pub struct AssetChangedState { _asset: PhantomData, } -#[allow(unsafe_code)] +#[expect(unsafe_code, reason = "WorldQuery is an unsafe trait.")] /// SAFETY: `ROQueryFetch` is the same as `QueryFetch` unsafe impl WorldQuery for AssetChanged { type Item<'w> = (); @@ -269,7 +269,7 @@ unsafe impl WorldQuery for AssetChanged { } } -#[allow(unsafe_code)] +#[expect(unsafe_code, reason = "QueryFilter is an unsafe trait.")] /// SAFETY: read-only access unsafe impl QueryFilter for AssetChanged { const IS_ARCHETYPAL: bool = false; diff --git a/crates/bevy_asset/src/handle.rs b/crates/bevy_asset/src/handle.rs index 9c61ff0f88c7b..19065ae6e84fa 100644 --- a/crates/bevy_asset/src/handle.rs +++ b/crates/bevy_asset/src/handle.rs @@ -551,8 +551,11 @@ mod tests { } /// Typed and Untyped `Handles` should be orderable amongst each other and themselves - #[allow(clippy::cmp_owned)] #[test] + #[expect( + clippy::cmp_owned, + reason = "This lints on the assertion that a typed handle converted to an untyped handle maintains its ordering compared to an untyped handle. While the conversion would normally be useless, we need to ensure that converted handles maintain their ordering, making the conversion necessary here." + )] fn ordering() { assert!(UUID_1 < UUID_2); diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs index bb34eed98c162..3d58b701b0c87 100644 --- a/crates/bevy_asset/src/lib.rs +++ b/crates/bevy_asset/src/lib.rs @@ -139,6 +139,11 @@ //! This trait mirrors [`AssetLoader`] in structure, and works in tandem with [`AssetWriter`](io::AssetWriter), which mirrors [`AssetReader`](io::AssetReader). #![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")] +#![deny( + clippy::allow_attributes, + clippy::allow_attributes_without_reason, + reason = "See #17111; To be removed once all crates are in-line with these attributes" +)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![doc( html_logo_url = "https://bevyengine.org/assets/icon.png", @@ -1767,8 +1772,11 @@ mod tests { #[derive(Asset, TypePath)] pub struct TestAsset; - #[allow(dead_code)] #[derive(Asset, TypePath)] + #[expect( + dead_code, + reason = "This exists to ensure that `#[derive(Asset)]` works on enums. The inner variants are known not to be used." + )] pub enum EnumTestAsset { Unnamed(#[dependency] Handle), Named { @@ -1783,7 +1791,6 @@ mod tests { Empty, } - #[allow(dead_code)] #[derive(Asset, TypePath)] pub struct StructTestAsset { #[dependency] @@ -1792,7 +1799,6 @@ mod tests { embedded: TestAsset, } - #[allow(dead_code)] #[derive(Asset, TypePath)] pub struct TupleTestAsset(#[dependency] Handle); } diff --git a/crates/bevy_asset/src/processor/mod.rs b/crates/bevy_asset/src/processor/mod.rs index 665ff7dd9e9ef..d32b98dcbe46d 100644 --- a/crates/bevy_asset/src/processor/mod.rs +++ b/crates/bevy_asset/src/processor/mod.rs @@ -478,7 +478,6 @@ impl AssetProcessor { self.set_state(ProcessorState::Finished).await; } - #[allow(unused)] #[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))] async fn process_assets_internal<'scope>( &'scope self, diff --git a/crates/bevy_asset/src/server/loaders.rs b/crates/bevy_asset/src/server/loaders.rs index e4be0841cfe8e..94a4af59e0113 100644 --- a/crates/bevy_asset/src/server/loaders.rs +++ b/crates/bevy_asset/src/server/loaders.rs @@ -342,18 +342,14 @@ mod tests { use super::*; - // The compiler notices these fields are never read and raises a dead_code lint which kill CI. - #[allow(dead_code)] #[derive(Asset, TypePath, Debug)] - struct A(usize); + struct A; - #[allow(dead_code)] #[derive(Asset, TypePath, Debug)] - struct B(usize); + struct B; - #[allow(dead_code)] #[derive(Asset, TypePath, Debug)] - struct C(usize); + struct C; struct Loader { sender: Sender<()>,