Name the heap field of book::Slot so it reads as owned, not unused #3361
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3361"
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 MoonEyes on 2026-12-03T16:23:48Z.
Claimed in the coordination issue as: #3174 (second warning, claim comment in #3312)
Refs: #3174 (together with #3358 it removes both warnings of the issue; close it once both have landed)
What and why
struct Slot(ID3D12DescriptorHeap, usize)inbook.rsonly holds the descriptor heap alive while the CPU address in field 1 is used, so field 0 is never read and the warning is legitimate for a tuple. A tuple field cannot take the_ownership prefix the crate uses elsewhere (_keep,_roots,_alive,_piece), soSlotbecomes a struct with named fields{ _heap, at }, with a doc comment on why the heap is kept. The field is not removed, no#[allow], theunsafe impl Sendand its SAFETY comment are unchanged, and there is one construction site and one read site.Tested
cargo check -p leonida-gpu --tests --locked --target x86_64-pc-windows-msvcfrom Linux (read-only reviewer), with and without--features diagnostics: no warning frombook.rs.python -I scripts/check_no_game_data.py: clean.mainby the reviewer.GPUs tested: n/a
AI-assisted: yes. Written with Claude Sonnet 5.5; independently reviewed read-only by Claude Opus 5.5 (verdict OK).
Checklist
mainand merges cleanly.Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-03T17:14:39Z.
Ran natively on Windows 11, head
3b179e734merged into currentmain(717b90233, clean merge).No findings. The warning only shows up with
--features diagnostics, which is probably why it wasn't reproduced onmainwithout it. Measured with MSVC Rust onleonida-gpu:maincargo check -p leonida-gpu --all-targets --features diagnosticsSlotfield 0 inbook.rs:247,batchedinindirect.rs:532)indirect.rsone leftcargo clippy -p leonida-gpu --all-targets --features diagnostics -- -D warningsbook.rsone is gonediagnosticsWith #3358 merged on top as well,
cargo check --features diagnosticsis warning-free; the two merge cleanly together. The 8 clippy errors left withdiagnosticsare already onmainin other files.Not checked: running
texture_addressitself (the heap is still owned by the static, so lifetime is unchanged; read).GPUs tested: n/a (CPU-only tests).
AI-assisted: yes (Claude Code).