greenfield: apply the root workspace's rustc lints everywhere #95
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!95
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-95"
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:19 UTC · original
TheRifai:rustc-lints-all→main· +104 −59 · 14 files · 1 commits · closed without mergingWhat
The root workspace denies
unsafe_op_in_unsafe_fnandunused_must_use, but greenfield and greenfield/wine never inherited them (docs/TASKS.md “The root workspace's rustc lints everywhere”, issue #41). Both workspaces now carry the same[workspace.lints.rust]table, and xtask'slint_tables_matchtest checks the rustc table as well as clippy. The unsafe operations that were implicitly allowed inunsafe fnbodies are wrapped in explicitunsafe {}blocks, each with a// SAFETY:note naming the caller contract.cargo fixproduced scope-correct wraps; every block was reviewed. No caller or rendering behaviour changed.The reference
The root
Cargo.tomlis the policy source; the two copies and the xtask check keep the fork's workspaces in sync with it, as they already do for clippy.Evidence
cargo check --workspace --all-targets --lockedclean in bothgreenfield/andgreenfield/wine/, with the deny in place.tools/build.shsucceeds.Checklist (docs/AGENTS.md)
docs/TASKS.mdnot edited (rule 29/31)unsafeblock has a// SAFETY:comment (rule 36)@vktory6 on GitHub · 2026-12-01 13:23 UTC · original
Thanks for widening it. Our comments crossed: you closed #94 a minute before my review there (#94), and this PR has the same shape, so the same points apply. In short:
{ unsafe { … }}). That is the same as before the lint; it should be one narrowunsafe { }per unsafe operation.// SAFETY:saying why that operation is sound there; the caller's contract goes in a/// # Safetydoc section on theunsafe fn.The lint-table part (both workspaces carry the root table, xtask checks it) is good as it is. If it helps, split it: one PR per crate for the unsafe sites (umem first) and the table switch last, once the sites are narrow. Holding this one until then.
@TheRifai on GitHub · 2026-12-01 13:33 UTC · original
Closing per review: reworking umem's unsafe sites with narrow blocks and specific SAFETY notes before re-enabling the lint.
Pull request closed