Make clippy pass on the #439 integration branch #442

Closed
github-bot wants to merge 3 commits from github-bot/gh-442 into review/local-integration-20261129 AGit
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 12:47 UTC · original
Kal0s-design:fix/439-clippy → review/local-integration-20261129 · +214 −55 · 34 files · 3 commits · closed without merging

Targets #439's branch (review/local-integration-20261129), where the Clippy job fails. With this PR, the CI commands pass locally on Windows:

  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean
  • the same with --all-features: clean
  • cargo check --workspace --profile diag --all-features --locked: clean
  • cargo test -p victory-gpu -p victory-hle -p victory-loader --lib: 555 / 228 / 72 passed. cargo test -p victory-shader --lib emit: 229 passed.
  • cargo xtask policy: ok. git diff --check: clean.

Two commits:

  1. d2ddf68: the two real lints. manual_is_multiple_of in emit/water_tile_slots.rs and let_and_return in an emit/mod.rs test helper.
  2. d9d4aaf: a SAFETY comment right before every block undocumented_unsafe_blocks flagged. #439 moves that lint from allow to warn, and CI's -D warnings makes each one an error: 89 without features, 131 with --all-features.
    • Most already had a comment clippy doesn't see. It was a "SAFETY (all)" / "(both)" note covering several blocks, a comment above a macro or a let with the unsafe further in, or a comment separated from its block by other statements. Those now repeat the author's own reason next to each block, or move next to it.
    • In timeline/hooks.rs the calls sit in macro input, where clippy only sees a comment inside the closure, so those closures become blocks. The test helper closure in indirect.rs gets the same treatment.
    • About a dozen had no comment. Those got a reason read from the surrounding code: compose.rs, indirect.rs's barrier pass, the FidelityFX host queries and destroy, the DualSense preparsed-data free and the panel's ntdll lookup.

Nothing else changes in the code. Worth a read where a reason is mine and not the original author's. Those are the blocks listed in the last point above.

AI-assisted: yes

🤖 Generated with Claude Code

**@⁠Kal0s-design** on GitHub · 2026-11-29 12:47 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/442) `Kal0s-design:fix/439-clippy` → `review/local-integration-20261129` · +214 −55 · 34 files · 3 commits · closed without merging Targets #439's branch (`review/local-integration-20261129`), where the Clippy job fails. With this PR, the CI commands pass locally on Windows: - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean - the same with `--all-features`: clean - `cargo check --workspace --profile diag --all-features --locked`: clean - `cargo test -p victory-gpu -p victory-hle -p victory-loader --lib`: 555 / 228 / 72 passed. `cargo test -p victory-shader --lib emit`: 229 passed. - `cargo xtask policy`: ok. `git diff --check`: clean. Two commits: 1. **d2ddf68:** the two real lints. `manual_is_multiple_of` in `emit/water_tile_slots.rs` and `let_and_return` in an `emit/mod.rs` test helper. 2. **d9d4aaf:** a SAFETY comment right before every block `undocumented_unsafe_blocks` flagged. #439 moves that lint from `allow` to `warn`, and CI's `-D warnings` makes each one an error: 89 without features, 131 with `--all-features`. - Most already had a comment clippy doesn't see. It was a "SAFETY (all)" / "(both)" note covering several blocks, a comment above a macro or a `let` with the `unsafe` further in, or a comment separated from its block by other statements. Those now repeat the author's own reason next to each block, or move next to it. - In `timeline/hooks.rs` the calls sit in macro input, where clippy only sees a comment inside the closure, so those closures become blocks. The test helper closure in `indirect.rs` gets the same treatment. - About a dozen had no comment. Those got a reason read from the surrounding code: `compose.rs`, `indirect.rs`'s barrier pass, the FidelityFX host queries and destroy, the DualSense preparsed-data free and the panel's ntdll lookup. Nothing else changes in the code. Worth a read where a reason is mine and not the original author's. Those are the blocks listed in the last point above. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`body.len() % 4 == 0` becomes `is_multiple_of(4)` and the test helper in
emit returns `lower(..)` directly instead of through a binding. Also
document four unsafe blocks in victory-loader and the shader tests. With
these, `cargo clippy --workspace --all-targets` (with and without
`--all-features`) has nothing left but undocumented_unsafe_blocks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 12:52:19 +00:00
github-bot changed title from Fix the two clippy errors on the #439 integration branch to Make clippy pass on the #439 integration branch 2026-11-29 13:13:18 +00:00
#439 turns undocumented_unsafe_blocks from allow into warn, and CI runs
clippy with -D warnings. Every block it flagged (89 without features,
131 with --all-features) now has a SAFETY comment right before it:

- Most already had one that clippy doesn't see: a "SAFETY (all)" or
  "(both)" comment for several blocks, a comment above a macro call or
  a `let` whose unsafe is further in, or a comment separated from its
  block by other statements. These now repeat the author's reason, or
  are moved next to the block, with the tag spelled "SAFETY:".
- In timeline/hooks.rs the wrappers' calls sit in macro input, where a
  comment is only seen inside the closure, so they become blocks.
- The rest (compose, indirect, the FidelityFX host queries and destroy,
  the dualsense report free, the ntdll lookup in the panel) get a reason
  read from the code around them.

No code changes besides the closures in hooks.rs and indirect's test
becoming blocks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 13:23 UTC · original

Thanks for addressing both real lints and the unsafe-block documentation. I integrated the changes locally, retaining the existing mapped-image safety check where the branches differed. Full Clippy validation on the consolidated tree is still pending.

**@⁠TaynanGT** on GitHub · 2026-11-29 13:23 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/442#issuecomment-7256501979) Thanks for addressing both real lints and the unsafe-block documentation. I integrated the changes locally, retaining the existing mapped-image safety check where the branches differed. Full Clippy validation on the consolidated tree is still pending.
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 14:49 UTC · original

Small follow-up, f70d0b8: six SAFETY comments in watch.rs came out doubled, the same line twice in a row (around the view and placeholder tests). They're harmless, but since you already integrated this locally you may want to drop them there too. Clippy is still clean with --all-features.

**@⁠Kal0s-design** on GitHub · 2026-11-29 14:49 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/442#issuecomment-7257601553) Small follow-up, f70d0b8: six SAFETY comments in `watch.rs` came out doubled, the same line twice in a row (around the view and placeholder tests). They're harmless, but since you already integrated this locally you may want to drop them there too. Clippy is still clean with `--all-features`.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 19:02 UTC · original

Thanks for catching the duplicate SAFETY comments. I'll keep the cleanup separate from the functional changes and retain the actual safety rationale. Your all-features Clippy result is useful; the consolidated tree still needs its own validation.

**@⁠TaynanGT** on GitHub · 2026-11-29 19:02 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/442#issuecomment-7260953719) Thanks for catching the duplicate SAFETY comments. I'll keep the cleanup separate from the functional changes and retain the actual safety rationale. Your all-features Clippy result is useful; the consolidated tree still needs its own validation.
github-bot closed this pull request 2026-11-30 17:08:36 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-30 17:06 UTC · original

main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:06 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/442#issuecomment-7285735847) `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.