fix(build): locked Clippy passes on Windows again #388

Merged
HumanBean merged 1 commit from llun/LongshotLauncher:fix/windows-clippy-dead-code into main 2026-12-01 05:23:16 +00:00
Member

On Windows, cargo clippy --locked --workspace --all-targets -- -D warnings fails on main. Two items are only used on Linux, so a Windows build reports them unused. #344 and #387 had to work around this with -A unused-imports -A dead_code.

  • src/game/process.rs: only the Unix pipe readers use AtomicBool. It is now imported in its own #[cfg(unix)] line, and the shared std::sync import keeps AtomicU8 and Ordering.
  • src/graphics_driver.rs: only graphics_driver/linux.rs reads Gpu::nvidia_proprietary and Gpu::info (added in #384). They now carry #[cfg_attr(not(target_os = "linux"), allow(dead_code))] with a note saying only Linux reads them, the same way vendor and device already do off Windows. The fields stay in the struct, so graphics_driver/windows.rs still builds them without changes.

No behaviour change. Linux compiles exactly what it compiled before: the import is still there under cfg(unix), and the allow does nothing on Linux.

Tested

Windows 11, the pinned toolchain (Rust 1.99.1, clippy 0.1.99):

  • cargo clippy --locked --workspace --all-targets -- -D warnings: on main (1fb2537) it fails with unused import: AtomicBool (src/game/process.rs:16) and fields `nvidia_proprietary` and `info` are never read (src/graphics_driver.rs:42). With this branch it passes.
  • cargo fmt --check (edition 2024): clean.

Not run here: Clippy on Linux. CI covers it.

🤖 Generated with Claude Code

On Windows, `cargo clippy --locked --workspace --all-targets -- -D warnings` fails on `main`. Two items are only used on Linux, so a Windows build reports them unused. #344 and #387 had to work around this with `-A unused-imports -A dead_code`. - `src/game/process.rs`: only the Unix pipe readers use `AtomicBool`. It is now imported in its own `#[cfg(unix)]` line, and the shared `std::sync` import keeps `AtomicU8` and `Ordering`. - `src/graphics_driver.rs`: only `graphics_driver/linux.rs` reads `Gpu::nvidia_proprietary` and `Gpu::info` (added in #384). They now carry `#[cfg_attr(not(target_os = "linux"), allow(dead_code))]` with a note saying only Linux reads them, the same way `vendor` and `device` already do off Windows. The fields stay in the struct, so `graphics_driver/windows.rs` still builds them without changes. No behaviour change. Linux compiles exactly what it compiled before: the import is still there under `cfg(unix)`, and the allow does nothing on Linux. ## Tested Windows 11, the pinned toolchain (Rust 1.99.1, clippy 0.1.99): - `cargo clippy --locked --workspace --all-targets -- -D warnings`: on `main` (1fb2537) it fails with `unused import: AtomicBool` (`src/game/process.rs:16`) and ``fields `nvidia_proprietary` and `info` are never read`` (`src/graphics_driver.rs:42`). With this branch it passes. - `cargo fmt --check` (edition 2024): clean. Not run here: Clippy on Linux. CI covers it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(build): locked Clippy passes on Windows again
Some checks failed
CI / What the change needs (pull_request) Successful in 4s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 10s
PR title / Conventional Commit title (pull_request) Successful in 6s
CI / Rust formatting, lint and tests (pull_request) Successful in 12m19s
CI / Release packages and stable upgrades (pull_request) Failing after 29m23s
d0cd7a6d61
Two items were used on Linux only, so a Windows build stopped
`cargo clippy --locked --workspace --all-targets -- -D warnings`:

- `AtomicBool` in src/game/process.rs is used only by the Unix pipe
  readers; it is now imported under `cfg(unix)`.
- `Gpu::nvidia_proprietary` and `Gpu::info` (from #384) are read only by
  graphics_driver/linux.rs; they now allow dead code off Linux, as
  `vendor` and `device` already do off Windows.

No behaviour change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The reported Windows Clippy run passes with these changes, which leave runtime behavior unchanged. The Linux CI checks are still running. Nothing blocking is left. Recommend approval; not approved on the forge.

This restores the strict Windows Clippy check by gating a Unix-only import and allowing two Linux-only field reads to be unused elsewhere. It adds no runtime cost.

Checks: Still running: 5 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes: the PR reports that locked workspace Clippy fails on the base with the two named warnings and passes on this branch on Windows 11. This is not a performance change.

Other systems: Linux retains the AtomicBool import and does not apply the new dead-code allowances. Windows retains both GPU fields and their initialization; no runtime paths change.

Switches: None.

Reviewed: d0cd7a6d61 against 1fb25370b1: Read AGENTS.md, CONTRIBUTING.md, the commit, both changed files and the relevant platform-specific uses. Skimmed the platform driver modules and CI workflow. No review checklist or pull request template was found at the specified paths.; nothing run (a code review).

Checked and fine:

  • All AtomicBool uses are under cfg(unix).
  • The GPU fields remain available to both platform implementations.
  • The commit includes an AI co-author trailer and changes no game-derived files.

Testing: The author reports Windows Clippy and formatting passed. Linux CI is still running; no commands from the project were run during review.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The reported Windows Clippy run passes with these changes, which leave runtime behavior unchanged. The Linux CI checks are still running. Nothing blocking is left. Recommend approval; not approved on the forge. This restores the strict Windows Clippy check by gating a Unix-only import and allowing two Linux-only field reads to be unused elsewhere. It adds no runtime cost. **Checks:** Still running: 5 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: the PR reports that locked workspace Clippy fails on the base with the two named warnings and passes on this branch on Windows 11. This is not a performance change. **Other systems:** Linux retains the AtomicBool import and does not apply the new dead-code allowances. Windows retains both GPU fields and their initialization; no runtime paths change. **Switches:** None. **Reviewed:** d0cd7a6d61b3 against 1fb25370b1ef: Read AGENTS.md, CONTRIBUTING.md, the commit, both changed files and the relevant platform-specific uses. Skimmed the platform driver modules and CI workflow. No review checklist or pull request template was found at the specified paths.; nothing run (a code review). **Checked and fine:** - All AtomicBool uses are under cfg(unix). - The GPU fields remain available to both platform implementations. - The commit includes an AI co-author trailer and changes no game-derived files. **Testing:** The author reports Windows Clippy and formatting passed. Linux CI is still running; no commands from the project were run during review. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/windows-clippy-dead-code 2026-12-01 05:23:16 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!388
No description provided.