From 01eff3ea937535bc7384ff361029129475d98263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Mon, 30 Jun 2025 00:09:37 +0200 Subject: [PATCH] bevy_render: fix clippy on wasm (#19872) # Objective - bevy_render has unfulfilled expected clippy lints in wasm ## Solution - Don't expect them in wasm ## Testing `cargo clippy --target wasm32-unknown-unknown -p bevy_render --no-deps -- -D warnings` --- .../src/batching/gpu_preprocessing.rs | 9 ++++++--- .../src/render_resource/pipeline_cache.rs | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/crates/bevy_render/src/batching/gpu_preprocessing.rs b/crates/bevy_render/src/batching/gpu_preprocessing.rs index ea5970431a..2fb0172b21 100644 --- a/crates/bevy_render/src/batching/gpu_preprocessing.rs +++ b/crates/bevy_render/src/batching/gpu_preprocessing.rs @@ -392,9 +392,12 @@ where } /// The buffer of GPU preprocessing work items for a single view. -#[expect( - clippy::large_enum_variant, - reason = "See https://github.com/bevyengine/bevy/issues/19220" +#[cfg_attr( + not(target_arch = "wasm32"), + expect( + clippy::large_enum_variant, + reason = "See https://github.com/bevyengine/bevy/issues/19220" + ) )] pub enum PreprocessWorkItemBuffers { /// The work items we use if we aren't using indirect drawing. diff --git a/crates/bevy_render/src/render_resource/pipeline_cache.rs b/crates/bevy_render/src/render_resource/pipeline_cache.rs index ebd3229636..0c75a5ca06 100644 --- a/crates/bevy_render/src/render_resource/pipeline_cache.rs +++ b/crates/bevy_render/src/render_resource/pipeline_cache.rs @@ -80,9 +80,12 @@ pub struct CachedPipeline { } /// State of a cached pipeline inserted into a [`PipelineCache`]. -#[expect( - clippy::large_enum_variant, - reason = "See https://github.com/bevyengine/bevy/issues/19220" +#[cfg_attr( + not(target_arch = "wasm32"), + expect( + clippy::large_enum_variant, + reason = "See https://github.com/bevyengine/bevy/issues/19220" + ) )] #[derive(Debug)] pub enum CachedPipelineState { @@ -1114,9 +1117,12 @@ fn create_pipeline_task( } /// Type of error returned by a [`PipelineCache`] when the creation of a GPU pipeline object failed. -#[expect( - clippy::large_enum_variant, - reason = "See https://github.com/bevyengine/bevy/issues/19220" +#[cfg_attr( + not(target_arch = "wasm32"), + expect( + clippy::large_enum_variant, + reason = "See https://github.com/bevyengine/bevy/issues/19220" + ) )] #[derive(Error, Debug)] pub enum PipelineCacheError {