fix(loader): gate diagnostics-only unwind_copy behind the diagnostics feature #38

Open
github-bot wants to merge 1 commit from github-bot/gh-38 into main AGit
Owner

@⁠imShangLi on GitHub · 2026-12-03 04:15 UTC · original
imShangLi:fix/crash-unwind-copy-cfg → main · +1 −0 · 1 files · 1 commits · open

What

Adds the missing #[cfg(feature = "diagnostics")] gate to unwind_copy in crates/victory-loader/src/crash.rs.

unwind_copy is only called from stacks.rs:207, and mod stacks is compiled only under #[cfg(all(windows, feature = "diagnostics"))] (crates/victory-loader/src/lib.rs:49). Without the diagnostics feature, crash.rs still defines the pub(crate) function, so the gate-1 clippy job (cargo clippy --workspace --all-targets --locked -D warnings, no --all-features) reports it as never-used and fails. The --all-features gate-2 job already compiles stacks.rs and uses the function, so it passes today.

The attribute matches the identical gate already present on save_on_crash, writes_zero and stacks_at_kill in the same file. No behaviour change.

Verification

  • cargo clippy -p victory-loader --all-targets --locked -- -D warnings on the pinned toolchain (1.98.1-x86_64-pc-windows-msvc) - clean, exit 0.
  • cargo clippy --workspace --all-targets --locked -- -D warnings on the same toolchain - the only victory-loader failure is gone; the remaining gate-1 failures are all in victory-shader and pre-exist on an unmodified main (see #37).
  • Pure Rust attribute change; no game data, no title bytes, no fixtures, no shader-cache invalidation.

Note on remaining CI failures

This PR fixes the victory-loader dead-code failure only. Gate-1 clippy still fails on a pristine main in victory-shader (E0063 missing field code_table in three HostShader test initializers in emit/mod.rs, plus clippy::useless_conversion in emit/lower/paired.rs:936 and clippy::while_immutable_condition in emit/lower/analysis.rs:467), and the policy-and-tests job fails on 5 asset-policy violations (docs/banner.jpg, docs/progress-en.svg, docs/progress-ru.svg, heap_sites/frame_users.rs). Those are separate pre-existing failures, unrelated to this diff - see #37.

Disclosure

Written by an AI agent (LobsterAI/DSH); verified locally with the commands above, reproducible on the pinned toolchain. No game data, no proprietary assets, no third-party names.

**@⁠imShangLi** on GitHub · 2026-12-03 04:15 UTC · [original](https://github.com/ToLIManl/VIctory-Hydra/pull/38) `imShangLi:fix/crash-unwind-copy-cfg` → `main` · +1 −0 · 1 files · 1 commits · open ## What Adds the missing `#[cfg(feature = "diagnostics")]` gate to `unwind_copy` in `crates/victory-loader/src/crash.rs`. `unwind_copy` is only called from `stacks.rs:207`, and `mod stacks` is compiled only under `#[cfg(all(windows, feature = "diagnostics"))]` (`crates/victory-loader/src/lib.rs:49`). Without the diagnostics feature, `crash.rs` still defines the `pub(crate)` function, so the gate-1 clippy job (`cargo clippy --workspace --all-targets --locked -D warnings`, no `--all-features`) reports it as never-used and fails. The `--all-features` gate-2 job already compiles `stacks.rs` and uses the function, so it passes today. The attribute matches the identical gate already present on `save_on_crash`, `writes_zero` and `stacks_at_kill` in the same file. No behaviour change. ## Verification - `cargo clippy -p victory-loader --all-targets --locked -- -D warnings` on the pinned toolchain (`1.98.1-x86_64-pc-windows-msvc`) - **clean, exit 0**. - `cargo clippy --workspace --all-targets --locked -- -D warnings` on the same toolchain - the only `victory-loader` failure is gone; the remaining gate-1 failures are all in `victory-shader` and pre-exist on an unmodified main (see #37). - Pure Rust attribute change; no game data, no title bytes, no fixtures, no shader-cache invalidation. ## Note on remaining CI failures This PR fixes the `victory-loader` dead-code failure only. Gate-1 clippy still fails on a pristine main in **victory-shader** (`E0063` missing field `code_table` in three `HostShader` test initializers in `emit/mod.rs`, plus `clippy::useless_conversion` in `emit/lower/paired.rs:936` and `clippy::while_immutable_condition` in `emit/lower/analysis.rs:467`), and the `policy-and-tests` job fails on 5 asset-policy violations (`docs/banner.jpg`, `docs/progress-en.svg`, `docs/progress-ru.svg`, `heap_sites/frame_users.rs`). Those are separate pre-existing failures, unrelated to this diff - see #37. ## Disclosure Written by an AI agent (LobsterAI/DSH); verified locally with the commands above, reproducible on the pinned toolchain. No game data, no proprietary assets, no third-party names.
unwind_copy is only called from stacks.rs:207, and mod stacks is compiled
under #[cfg(all(windows, feature = "diagnostics"))] (lib.rs:49). Without
the diagnostics feature, crash.rs still defines the pub(crate) function, so
the gate-1 clippy job (no --all-features) reports it as never-used and fails.

Gate unwind_copy with #[cfg(feature = "diagnostics")] to match the
attribute already used on save_on_crash, writes_zero and stacks_at_kill in
the same file. No behaviour change; the --all-features gate already used it.

Unblocks every external PR red on this pre-existing dead-code error (#37).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 04:17:50 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/38/head:github-bot/gh-38'
git switch 'github-bot/gh-38'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-38'
git switch 'github-bot/gh-38'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-38'
git switch 'github-bot/gh-38'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-38'
git switch 'main'
git merge --squash 'github-bot/gh-38'
git switch 'main'
git merge --ff-only 'github-bot/gh-38'
git switch 'main'
git merge 'github-bot/gh-38'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.