Diagnostics-only barrier stats: six needless borrows the all-features gate refuses #3086

Open
TheSovietWaffle wants to merge 1 commit from upstream-pr/3086 into main
TheSovietWaffle commented 2026-11-29 19:56:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by TheSovietWaffle on 2026-11-29T19:56:07Z.


The build half of this is in main now (41adb55, "Diagnostics build compiles again"): the mb helper in log_heap_elsewhere and self::timing() at the three submission sites. What is left is the second gate: with the diagnostics feature on, clippy -D warnings refuses six barstat::rb calls that pass a reference to an already-borrowed list.

What it changes

Six diagnostics-only barrier-stat calls pass the list they already have:

  • crates/victory-gpu/src/host.rs: two crate::barstat::rb(&list, …) in the read-back capture.
  • crates/victory-gpu/src/compose.rs: four rb(&l, …) / rb(&cmds, …) in the display-plane tests.

barstat::rb takes &ID3D12GraphicsCommandList, so the extra & is a reference to a reference; clippy::needless_borrows refuses it under -D warnings. They sit behind feature = "diagnostics", so no earlier lint run could see them: the plain Clippy step never compiles them, and the --all-features step never ran while the build was broken.

How it was tested

  • cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings: the six errors before, none after. The one remaining needless_borrows in that run is crates/victory-gpu/src/list.rs:2692 (handles), which is not a barstat call and not touched here.
  • cargo check -p victory-gpu --tests --profile diag --features diagnostics: Finished (with 41adb55 in the base).
  • No title, GPU profile or game data is involved; the change is six & removals in diagnostics-only code.

Checked for overlap

  • I searched the open pull requests for these files and for barstat. Related: #2792 and #3385 repair the first Clippy gate on main (unused imports and the like, #2019); #2772 covers other victory-gpu findings, including list.rs:2692; none removes these six borrows.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5554512363 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3086). Originally posted by [TheSovietWaffle](https://github.com/TheSovietWaffle) on 2026-11-29T19:56:07Z. --- The build half of this is in `main` now (41adb55, "Diagnostics build compiles again"): the `mb` helper in `log_heap_elsewhere` and `self::timing()` at the three submission sites. What is left is the second gate: with the diagnostics feature on, `clippy -D warnings` refuses six `barstat::rb` calls that pass a reference to an already-borrowed list. ## What it changes Six diagnostics-only barrier-stat calls pass the list they already have: - `crates/victory-gpu/src/host.rs`: two `crate::barstat::rb(&list, …)` in the read-back capture. - `crates/victory-gpu/src/compose.rs`: four `rb(&l, …)` / `rb(&cmds, …)` in the display-plane tests. `barstat::rb` takes `&ID3D12GraphicsCommandList`, so the extra `&` is a reference to a reference; `clippy::needless_borrows` refuses it under `-D warnings`. They sit behind `feature = "diagnostics"`, so no earlier lint run could see them: the plain Clippy step never compiles them, and the `--all-features` step never ran while the build was broken. ## How it was tested - `cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings`: the six errors before, none after. The one remaining `needless_borrows` in that run is `crates/victory-gpu/src/list.rs:2692` (`handles`), which is not a `barstat` call and not touched here. - `cargo check -p victory-gpu --tests --profile diag --features diagnostics`: `Finished` (with 41adb55 in the base). - No title, GPU profile or game data is involved; the change is six `&` removals in diagnostics-only code. ## Checked for overlap - [x] I searched the open pull requests for these files and for `barstat`. Related: #2792 and #3385 repair the first Clippy gate on `main` (unused imports and the like, #2019); #2772 covers other `victory-gpu` findings, including `list.rs:2692`; none removes these six borrows.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3086:upstream-pr/3086'
git switch 'upstream-pr/3086'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3086'
git switch 'upstream-pr/3086'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3086'
git switch 'upstream-pr/3086'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3086'
git switch 'main'
git merge --squash 'upstream-pr/3086'
git switch 'main'
git merge --ff-only 'upstream-pr/3086'
git switch 'main'
git merge 'upstream-pr/3086'
git push origin 'main'
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
trustno1-coder/VIctory-NVIDIA!3086
No description provided.