Turn undocumented_unsafe_blocks back on: six SAFETY comments the lint can read #30

Open
viktoschi wants to merge 1 commit from upstream-pr/30 into main
viktoschi commented 2026-11-24 20:35:11 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by viktoschi on 2026-11-24T20:35:11Z.


What this does

Turns undocumented_unsafe_blocks back on. The workspace comment said eleven
blocks in the newer GPU code still lacked a safety comment; six were still
reported, and all six had a comment — just not one the lint reads.

Site What was wrong
victory-gpu/src/host.rs:5370 the SAFETY: above belonged to the zeroed() on the line before; the VirtualQuery call had none of its own
victory-gpu/src/indirect.rs:376 the SAFETY: for the whole block sat above the diagnostics lets, not above the unsafe
victory-gpu/src/indirect.rs:701 SAFETY (each): — the lint wants SAFETY:
inplace.rs:617, :685, :760 SAFETY (the whole function): — same form problem

Each comment now states the same invariant as before, in the form the lint
recognises; the clamp's comment moved down to its block and the sparse read's
VirtualQuery got its own.

Cargo.toml:

undocumented_unsafe_blocks = "warn"

so the next block added without a SAFETY: comment fails -D warnings.

Checks

  • cargo clippy --workspace --all-targets --locked -- -D warnings — clean
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings — clean
  • cargo test --workspace --locked — all green (211 passed, 2 ignored; the GPU tests ran on an RTX 3090)
  • cargo xtask install-hooks + the pre-commit asset policy on this commit — 4 files ok

No code changed: comments and the lint level only.

Not in this PR

type_complexity (7 sites) and needless_range_loop (9 sites) stay allowed —
those want type aliases and loop rewrites in the translator, not a comment.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6590891191 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/30). Originally posted by [viktoschi](https://github.com/viktoschi) on 2026-11-24T20:35:11Z. --- ## What this does Turns `undocumented_unsafe_blocks` back on. The workspace comment said eleven blocks in the newer GPU code still lacked a safety comment; six were still reported, and all six had a comment — just not one the lint reads. | Site | What was wrong | | --- | --- | | `victory-gpu/src/host.rs:5370` | the `SAFETY:` above belonged to the `zeroed()` on the line before; the `VirtualQuery` call had none of its own | | `victory-gpu/src/indirect.rs:376` | the `SAFETY:` for the whole block sat above the diagnostics `let`s, not above the `unsafe` | | `victory-gpu/src/indirect.rs:701` | `SAFETY (each):` — the lint wants `SAFETY:` | | `inplace.rs:617`, `:685`, `:760` | `SAFETY (the whole function):` — same form problem | Each comment now states the same invariant as before, in the form the lint recognises; the clamp's comment moved down to its block and the sparse read's `VirtualQuery` got its own. `Cargo.toml`: ```toml undocumented_unsafe_blocks = "warn" ``` so the next block added without a `SAFETY:` comment fails `-D warnings`. ## Checks - `cargo clippy --workspace --all-targets --locked -- -D warnings` — clean - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` — clean - `cargo test --workspace --locked` — all green (211 passed, 2 ignored; the GPU tests ran on an RTX 3090) - `cargo xtask install-hooks` + the pre-commit asset policy on this commit — 4 files ok No code changed: comments and the lint level only. ## Not in this PR `type_complexity` (7 sites) and `needless_range_loop` (9 sites) stay allowed — those want type aliases and loop rewrites in the translator, not a comment.
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/30:upstream-pr/30'
git switch 'upstream-pr/30'

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/30'
git switch 'upstream-pr/30'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/30'
git switch 'upstream-pr/30'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/30'
git switch 'main'
git merge --squash 'upstream-pr/30'
git switch 'main'
git merge --ff-only 'upstream-pr/30'
git switch 'main'
git merge 'upstream-pr/30'
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
fxceless/victory-fork!30
No description provided.