From 05b1c5a2e3974b1ef3b18bb0901f4ff809a68f85 Mon Sep 17 00:00:00 2001 From: Diego Guerini <106814760+D13GOOOO@users.noreply.github.com> Date: Mon, 19 Oct 2026 08:43:28 +0200 Subject: [PATCH] #2845 follow-up: clippy passes on Windows and Linux again (#3006) `graphics.rs` allowed dead code only on macOS (where the Windows items are unused). Since #2845 the two indirect-validation functions are called only on macOS, so on Windows and Linux `cargo clippy --workspace --all-targets -- -D warnings` stopped with "function is never used". They now carry `allow(dead_code)` off macOS. Co-authored-by: Claude Opus 5.5 (cherry picked from commit 18c7c1d114463c3ef925cd241596b6ee49a4c4d2) --- apps/wordcraft/src/graphics.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/wordcraft/src/graphics.rs b/apps/wordcraft/src/graphics.rs index 65c519ea7..0edd57666 100644 --- a/apps/wordcraft/src/graphics.rs +++ b/apps/wordcraft/src/graphics.rs @@ -1,6 +1,7 @@ //! Graphics instance configuration applied before wgpu can initialize any driver: Windows //! backends and the DirectX 12 shader compiler, and the Intel Mac indirect-validation skip. -// On macOS only the indirect-validation items are used outside tests. +// On macOS only the indirect-validation items are used outside tests. Elsewhere it is the other +// way round, so those two carry their own `allow`. #![cfg_attr(target_os = "macos", allow(dead_code))] use eframe::{ @@ -14,12 +15,14 @@ use eframe::{ /// compiler aborts on them, the device is lost and eframe exits before the window opens. WordCraft /// issues no indirect draws or dispatches, so Intel Macs skip them; every other GPU keeps wgpu's /// default. Same fix as PhotoCraft's storytold/PhotoCraft#3171. +#[cfg_attr(not(target_os = "macos"), allow(dead_code))] pub fn skips_indirect_validation(macos: bool, intel: bool) -> bool { macos && intel } /// Leaves wgpu's indirect-call validation out of the instance eframe creates when `skip`. /// `WGPU_VALIDATION_INDIRECT_CALL=1` still turns it back on. +#[cfg_attr(not(target_os = "macos"), allow(dead_code))] pub fn configure_indirect_validation(options: &mut NativeOptions, skip: bool) { if !skip { return;