umem: narrow unsafe blocks for the rustc lint #101
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/vktory6--VKtory!101
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-101"
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?
@TheRifai on GitHub · 2026-12-01 13:39 UTC · original
TheRifai:umem-unsafe-narrow→main· +176 −42 · 5 files · 1 commits · merged 2026-12-01 14:00 UTCWhat
Reworks the rejected
#95shape for umem (docs/TASKS.md “The root workspace's rustc lints everywhere”, issue #41).unsafe_op_in_unsafe_fnis denied for umem only. Every unsafe operation inside anunsafe fnnow has its own narrowunsafe { … }block with a// SAFETY:note about that operation, and eachunsafe fncarries a/// # Safetysection stating the caller's contract. No whole-function wraps remain. Where a precondition could not be verified from the code, the note says so instead of asserting it.The workspace-lint table and xtask check are deliberately left out of this PR, per the review: they come after the other crates' unsafe sites are narrow.
The reference
The root Cargo.toml's rustc lint table is the policy source; this brings umem partway there.
Evidence
cargo check -p umem --all-targets --locked,tools/build.sh, CI's native tests (11 + 16 + 151) and policy (6) pass with the deny in place.umem/tests/bench.rstest fails locally withERROR_INVALID_OPAQUE_CAPTURE_ADDRESSon this RADV setup; it is not in CI's test set and is unrelated to these edits.Checklist (docs/AGENTS.md)
docs/TASKS.mdnot edited (rule 29/31)// SAFETY:note; unsafe fns have a/// # Safetycontract (rule 36)@vktory6 on GitHub · 2026-12-01 14:01 UTC · original
Merged as
f104060, thank you! This is exactly the shape that was meant: narrow blocks, a reason per operation, the callers' contracts in# Safety, and "not proven" where it isn't. #102 (with one fix, see there) and #104 are in the queue.