Shaders: gate the constant_color test helper to Windows #685

Merged
catminou4 merged 1 commit from upstream-pr/685 into main 2026-11-24 08:23:32 +00:00
catminou4 commented 2026-11-24 06:50:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:50:17Z.


Summary

constant_color() in crates/victory-shader/src/emit/mod.rs is only called by two tests that are themselves #[cfg(windows)] (stub_pipeline_is_created, constant_color_validates). On macOS and Linux the helper compiles but is dead code, so cargo check -p victory-shader --all-targets warns:

warning: function `constant_color` is never used

This gates the helper with #[cfg(windows)], matching its callers — one line, no behavior change on Windows.

Verification

On macOS 26 arm64, rustc 1.98.1, base main (d2a4bae):

  • before: warning: function constant_color is never used in lib test
  • after: warning gone (cargo check -p victory-shader --all-targets --locked clean)
  • cargo test -p victory-shader --locked: 56 passed, 0 failed (unchanged)

The Windows-only tests that use the helper are unaffected (still compiled there).

<!-- greyfinch-sync:Marvisak/VIctory:issue:6576326848 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/685). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T06:50:17Z. --- ## Summary `constant_color()` in `crates/victory-shader/src/emit/mod.rs` is only called by two tests that are themselves `#[cfg(windows)]` (`stub_pipeline_is_created`, `constant_color_validates`). On macOS and Linux the helper compiles but is dead code, so `cargo check -p victory-shader --all-targets` warns: ``` warning: function `constant_color` is never used ``` This gates the helper with `#[cfg(windows)]`, matching its callers — one line, no behavior change on Windows. ## Verification On macOS 26 arm64, rustc 1.98.1, base `main` (`d2a4bae`): - before: `warning: function constant_color is never used` in lib test - after: warning gone (`cargo check -p victory-shader --all-targets --locked` clean) - `cargo test -p victory-shader --locked`: 56 passed, 0 failed (unchanged) The Windows-only tests that use the helper are unaffected (still compiled there).
LAKSHYA-cmd-tech commented 2026-11-24 07:07:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T07:01:57Z.

Review: APPROVED


LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 69 unit tests in ictory-shader passed cleanly. Adding #[cfg(windows)] to constant_color eliminates the unused function warning on Linux/macOS without altering Windows test functionality.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034991202 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/685#pullrequestreview-6034991202). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T07:01:57Z. **Review:** APPROVED --- LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 69 unit tests in ictory-shader passed cleanly. Adding #[cfg(windows)] to constant_color eliminates the unused function warning on Linux/macOS without altering Windows test functionality.
upstream-sync closed this pull request 2026-11-24 09:05:56 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!685
No description provided.