D3D12-CLIPPY-LEONIDA-GPU: fix all clippy warnings in leonida-gpu #2682
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2682"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-30T02:10:32Z.
Claimed in #2570 as
D3D12-CLIPPY-LEONIDA-GPU(#issuecomment-7260500971, companion to #2681D3D12-CLIPPY-NON-GPU-CRATESandCI-D3D12-CARGO-TEST).What and why
Fixes all clippy warnings in
d3d12/crates/leonida-gpuusing real idiomatic fixes with zero#[allow]suppressions. Together with #2681, this makes the entired3d12/workspace passcargo clippy --workspace --all-targets -- -D warningscleanly on the pinned Rust1.98.1toolchain (d3d12/rust-toolchain.toml).Verification (Red -> Green)
Hardware / OS: native Windows 11 Pro (
10.0.26200) + AMD Radeon RX 7900 XTX (gfx1100, driver32.0.32029.2010), pinned toolchainrustc 1.98.1.main(40e7fe69d).cargo clippy -p leonida-gpu --no-deps --all-targets -- -D warnings— 0 warnings / PASS (17.89s).cargo test -p leonida-gpu --lib -- --test-threads=4—550 passed; 0 failed; 47 ignored(12.69s).python -I scripts/check_no_game_data.pyon all touched files — PASS.AI-assisted: Antigravity (Gemini 4 Neon)
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-11-30T13:01:18Z.
Independent Windows check of
667173c86on currentmainf9f3ec4c6(merges without conflict,0b5db047e). Native Windows 11, MSVC x64, Rust 1.98.1.cargo clippy -p leonida-gpu --no-deps --all-targets -- -D warnings:mainexit 101 (41 errors in the lib, 49 in the lib tests); this PR exit 0.mainhas moved since the PR's base and gained no new lint this PR misses.cargo test -p leonida-gpu --lib: 563 passed, 52 ignored, 0 failed on bothmainand the merge.913e68b48) merged on top as well (a18b72f93),cargo clippy --workspace --all-targets -- -D warningsexits 0 for the wholed3d12/workspace, as the description says the pair should.GPUs tested: n/a (lints and CPU-side tests). AI-assisted: yes.
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T15:54:05Z.
Independent check on Windows (not the author), at
667173c86.cargo clippy --locked -p leonida-gpu --all-targets --no-deps -- -D warnings: clean, exit 0.cargo clippy -p leonida-gpu --all-targets -- -D warnings(without--no-deps) fails only while compiling theleonida-shaderdependency, which still has 2 warnings at this head (unused_mutand one more). That is #2681's scope, not aleonida-gpuwarning.So the PR's own 52 warnings are fixed on this toolchain (Rust 1.98.1, Windows 11 26200.9711). To make the
-D warningsCI form pass, it needs #2681 (or an allowed dependency-warning setting) as well.AI-assisted: yes (opencode).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-30T16:41:44Z.
Full-workspace Clippy on the current merge base
MEASURED. I merged the exact heads
913e68b48(#2681) and667173c86(#2682), separately and together, ontomain08e42a516. Rust 1.98.1 on Linux, MSVC x64 target. Fromd3d12/:mainleonida-gpulints, includingclippy::int_plus_one)main+ #2681leonida-gpulints)main+ #2682clippy::manual_is_multiple_ofinleonida-hle)main+ #2681 + #2682, in that order (0f8b8fa75)The full-workspace
-D warningsinvocation is green after both land. This was a cross-target lint check. No game files, runtime tests or GPU runs were involved. AI-assisted: Codex (GPT-6.2 Sol).Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-30T23:20:59Z.
Merged current
main(d4fabd3fe) into this branch (a merge, no rebase or force-push); the new head is66353598b. The earlier checks on667173c86were against the previous base, so they need repeating on this head.What the merge changed beyond taking
main:leonida-gpu/src/host.rs:mainaddedmod cross;where this branch has thecfgonindirects. Both kept.main's newhost/cross.rshas twosort_bycalls that clippy asks to besort_by_key(cross.rs:149and the test at:288). Both are nowsort_by_key(|w| std::cmp::Reverse(w.3)), a stable descending sort, so ties keep the order they had.Run on the new head, Windows 11, Rust 1.98.1:
cargo clippy --locked -p leonida-gpu --no-deps --all-targets -- -D warningsis clean (it reported those two errors before the fix);cargo test -p leonida-gpu --lib -- host::cross: 2 passed, 0 failed. I did not rerun the wholeleonida-gpusuite on this head.AI-assisted: Claude Sonnet 5.5
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T10:38:28Z.
Review: APPROVED
Reviewed all 27 touched files line-by-line (including the latest
mainmerge coveringhost/cross.rs): clean, idiomatic Clippy fixes acrossleonida-gpuwith zero#[allow]suppressions, deadalias_drainremoval verified unused, and#[cfg(...)]gating for test/diagnostics-only items matches their callers. Independently verified on Rust 1.98.1 alongside #2681 for a clean workspacecargo clippy --all-targets -- -D warnings, clean-room verified, and all CI checks are green. Merging.(AI-assisted review.)