There’s a warning about an unused method ranged in crates/victory-gpu/src/shadow.rs:7197. This is just a dead code warning — the build will still succeed. #4121

Open
opened 2026-11-30 16:22:17 +00:00 by HBF7678 · 4 comments
HBF7678 commented 2026-11-30 16:22:17 +00:00 (Migrated from github.com)
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by HBF7678 on 2026-11-30T16:22:17Z.


Compiling clap v4.6.9
Compiling victory-game v0.1.0 (C:\Users\Admin\Downloads\Xbox_game_build\VIctory-NVIDIA\crates\victory-game)
warning: method ranged is never used
--> crates\victory-gpu\src\shadow.rs:7197:8
|
5822 | impl Shadow {
| ----------- method in this implementation
...
7197 | fn ranged(&self, from: usize, to: usize) -> u64 {
| ^^^^^^
|
= note: #[warn(dead_code)] (part of #[warn(unused)]) on by default

Compiling victory-hle v0.1.0 (C:\Users\Admin\Downloads\Xbox_game_build\VIctory-NVIDIA\crates\victory-hle)
Building [=======================> ] 118/120: victory-gpu

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:6700944096 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4121). Originally posted by [HBF7678](https://github.com/HBF7678) on 2026-11-30T16:22:17Z. --- Compiling clap v4.6.9 Compiling victory-game v0.1.0 (C:\Users\Admin\Downloads\Xbox_game_build\VIctory-NVIDIA\crates\victory-game) warning: method `ranged` is never used --> crates\victory-gpu\src\shadow.rs:7197:8 | 5822 | impl Shadow { | ----------- method in this implementation ... 7197 | fn ranged(&self, from: usize, to: usize) -> u64 { | ^^^^^^ | = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default Compiling victory-hle v0.1.0 (C:\Users\Admin\Downloads\Xbox_game_build\VIctory-NVIDIA\crates\victory-hle) Building [=======================> ] 118/120: victory-gpu
github-actions[bot] commented 2026-11-30 16:22:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by github-actions[bot] on 2026-11-30T16:22:28Z.


Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7284561047 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4121#issuecomment-7284561047). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T16:22:28Z. --- Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
HBF7678 commented 2026-11-30 16:23:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by HBF7678 on 2026-11-30T16:23:41Z.


Screenshot 2026-11-30 215519

Win 11,rtx 5060 8gb, 32 gb ram

victory-nvidia-20261130-214917.log

The game didnt crash

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7284593174 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4121#issuecomment-7284593174). Originally posted by [HBF7678](https://github.com/HBF7678) on 2026-11-30T16:23:41Z. --- <img width="365" height="459" alt="Screenshot 2026-11-30 215519" src="https://github.com/user-attachments/assets/bb7c277f-dc47-48ad-aea8-96342474769c" /> Win 11,rtx 5060 8gb, 32 gb ram [victory-nvidia-20261130-214917.log](https://github.com/user-attachments/files/35628853/victory-nvidia-20261130-214917.log) The game didnt crash
cloph-dsp commented 2026-11-30 16:32:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-11-30T16:32:56Z.


Finding: the dead_code warning on Shadow::ranged (shadow.rs:7197 in the build that reported it) is real on current main, and the method is unreachable for a reason that looks like a bug rather than leftovers.

On 2c28b27d (my shallow main) ranged sits at shadow.rs:4215 and keeps two callers, so it is not dead by construction:

  • shadow.rs:4203, inside nothing_new, runs unconditionally for a guarded range.
  • shadow.rs:4319, copy_stale, runs only when crate::watch::light() is true — and watch::light() is VICTORY_LIGHT_REFRESH, on unless "0". So in a default build both callers are live.

The line number in the warning (7197) does not exist in this tree, so that build carries a longer shadow.rs than 2c28b27d. The likeliest reading is that the warning's build is ahead of this checkout and something above it changed the reachability, so the warning is worth a look on the exact commit that produced it rather than a blanket #[allow(dead_code)].

Concretely, a plausible cause in this file: refresh_check (shadow.rs:4259) is itself an env-gated diagnostic (VICTORY_REFRESH_CHECK=1) yet is called unconditionally from update_free, while copy_stale's ranged use is behind watch::light(). If a build compiles the VICTORY_LIGHT_REFRESH path out (or the reporter's tree moved that gate into a #[cfg]), copy_stale stops using ranged and only the nothing_new caller keeps it alive — which is exactly when the compiler starts calling the method unused if that caller is also gated.

cargo check --locked -p victory-gpu --lib on 2c28b27d at HEAD produces no dead_code warning for ranged (only seven unrelated fetch_update deprecations), so I cannot reproduce it here and have not changed anything.

Two things would settle it: the commit hash of the build that printed the warning, and whether the reporter's shadow.rs line 7197 sits above or below the watch::light() call in copy_stale. If the answer is "below", the gate was moved and the fix is to keep the ranged lookup live (e.g. let copy_stale take it unconditionally and have light() short-circuit inside), not to silence the warning.

AI-assisted: Hy4 flash. No game data, assets, extracted shaders or DRM used.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7284846679 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4121#issuecomment-7284846679). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-30T16:32:56Z. --- Finding: the `dead_code` warning on `Shadow::ranged` (shadow.rs:7197 in the build that reported it) is real on current `main`, and the method is unreachable for a reason that looks like a bug rather than leftovers. On `2c28b27d` (my shallow `main`) `ranged` sits at shadow.rs:4215 and keeps two callers, so it is not dead by construction: - `shadow.rs:4203`, inside `nothing_new`, runs unconditionally for a guarded range. - `shadow.rs:4319`, `copy_stale`, runs only when `crate::watch::light()` is true — and `watch::light()` is `VICTORY_LIGHT_REFRESH`, on unless `"0"`. So in a default build both callers are live. The line number in the warning (7197) does not exist in this tree, so that build carries a longer shadow.rs than `2c28b27d`. The likeliest reading is that the warning's build is ahead of this checkout and something above it changed the reachability, so the warning is worth a look on the exact commit that produced it rather than a blanket `#[allow(dead_code)]`. Concretely, a plausible cause in this file: `refresh_check` (shadow.rs:4259) is itself an env-gated diagnostic (`VICTORY_REFRESH_CHECK=1`) yet is called unconditionally from `update_free`, while `copy_stale`'s `ranged` use is behind `watch::light()`. If a build compiles the `VICTORY_LIGHT_REFRESH` path out (or the reporter's tree moved that gate into a `#[cfg]`), `copy_stale` stops using `ranged` and only the `nothing_new` caller keeps it alive — which is exactly when the compiler starts calling the method unused if that caller is also gated. `cargo check --locked -p victory-gpu --lib` on `2c28b27d` at HEAD produces no `dead_code` warning for `ranged` (only seven unrelated `fetch_update` deprecations), so I cannot reproduce it here and have not changed anything. Two things would settle it: the commit hash of the build that printed the warning, and whether the reporter's shadow.rs line 7197 sits above or below the `watch::light()` call in `copy_stale`. If the answer is "below", the gate was moved and the fix is to keep the `ranged` lookup live (e.g. let `copy_stale` take it unconditionally and have `light()` short-circuit inside), not to silence the warning. AI-assisted: Hy4 flash. No game data, assets, extracted shaders or DRM used.
Raesdf commented 2026-11-30 17:00:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Raesdf on 2026-11-30T17:00:15Z.


Hi, I checked this in my checkout: Shadow::ranged has no callers here.
nothing_new uses ranged_lockfree_parts and copy_stale uses ranged_parts directly, so searching for .ranged( gives 0 results.

Could you share the commit hash of the build that printed the warning?
And on current main, is ranged still called from nothing_new / copy_stale, or is it dead there too?

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7285566760 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4121#issuecomment-7285566760). Originally posted by [Raesdf](https://github.com/Raesdf) on 2026-11-30T17:00:15Z. --- Hi, I checked this in my checkout: `Shadow::ranged` has no callers here. `nothing_new` uses `ranged_lockfree_parts` and `copy_stale` uses `ranged_parts` directly, so searching for `.ranged(` gives 0 results. Could you share the commit hash of the build that printed the warning? And on current main, is `ranged` still called from `nothing_new` / `copy_stale`, or is it dead there too?
Sign in to join this conversation.
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
trustno1-coder/VIctory-NVIDIA#4121
No description provided.