wine crates: narrow unsafe blocks for the rustc lint #102
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!102
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-102"
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:49 UTC · original
TheRifai:wine-unsafe-narrow→main· +26 −11 · 3 files · 2 commits · merged 2026-12-01 14:07 UTCWhat
The three wine crates (
umem-pe,umem-unix,vkback-unix) now denyunsafe_op_in_unsafe_fn(docs/TASKS.md “The root workspace's rustc lints everywhere”, issue #41). Following the review that rejected the whole-function wraps, every unsafe operation inside anunsafe fnhas its own narrowunsafe { … }block with a// SAFETY:note about that operation. The existing/// # Safetycaller contracts onumem_initandumem_callare kept.The reference
The root Cargo.toml's rustc lint table is the policy source; this is the wine-crates step after umem.
Evidence
cargo check --workspace --all-targets --lockedingreenfield/wine/andtools/build.shpass with the deny in place.cargo testofumem-pecannot linkkernel32on Linux (pre-existing: that crate is built for Windows with xwin in CI), so compile checks are the gate here.Checklist (docs/AGENTS.md)
docs/TASKS.mdnot edited (rule 29/31)/// # Safety(rule 36)@vktory6 on GitHub · 2026-12-01 14:07 UTC · original
Merged as
5932bf9, thanks! One real fix on my side: inumem-pe'sumem_initthe literal"\\??\\Z:"had become"\\\\??\\Z:", which turns the NT prefix\??\Z:into\\??\Z:and breaks loading the Unix library. Nothing in the build or the tests runs that path, only a game start would have shown it, so it's worth a careful look when a mechanical rewrite touches string literals. The first SAFETY note also said kernel32 where the call is for ntdll.