lint tables: inherit the root rust lints in both greenfield workspaces #108

Manually merged
github merged 2 commits from github-bot/gh-108 into gh-pr/108/base 2026-12-01 14:29:47 +00:00 AGit
Owner

@⁠TheRifai on GitHub · 2026-12-01 14:17 UTC · original
TheRifai:lint-table-final → main · +74 −37 · 8 files · 2 commits · merged 2026-12-01 14:29 UTC

What

Finishes docs/TASKS.md “The root workspace's rustc lints everywhere” (issue #41). Both greenfield workspaces now inherit the root [workspace.lints.rust] table (unsafe_op_in_unsafe_fn, unused_must_use), and xtask's lint_tables_match checks the rust table alongside clippy. The unsafe operations in test and bin targets, which crate attributes in lib.rs do not cover, have narrow unsafe {} blocks with SAFETY notes. The library sites were done in #101/#102/#104, now merged.

The reference

The root Cargo.toml is the policy source; the two copies and the xtask check keep the fork's workspaces in sync with it.

Evidence

  • cargo check --workspace --all-targets --locked clean in both greenfield/ and greenfield/wine/ with the deny inherited.
  • Root tests (240 + xtask 6), greenfield library tests (11 + 16 + 151) and policy (6) pass; tools/build.sh succeeds.

Checklist (docs/AGENTS.md)

  • One topic; docs/TASKS.md not edited (rule 29/31)
  • No fallback added (rule 33)
  • No constants or switches added (rules 2/9b)
  • No queues changed (rule 35)
  • Narrow unsafe blocks with SAFETY notes (rule 36)
  • Check, build and tests pass; no translator output change (rule 27)
  • Comments say what is true now (rule 3)
  • Nothing from the title, no non-free data pointers (hard constraints)
**@⁠TheRifai** on GitHub · 2026-12-01 14:17 UTC · [original](https://github.com/vktory6/VKtory/pull/108) `TheRifai:lint-table-final` → `main` · +74 −37 · 8 files · 2 commits · merged 2026-12-01 14:29 UTC ## What Finishes docs/TASKS.md “The root workspace's rustc lints everywhere” (issue #41). Both greenfield workspaces now inherit the root `[workspace.lints.rust]` table (`unsafe_op_in_unsafe_fn`, `unused_must_use`), and xtask's `lint_tables_match` checks the rust table alongside clippy. The unsafe operations in test and bin targets, which crate attributes in `lib.rs` do not cover, have narrow `unsafe {}` blocks with SAFETY notes. The library sites were done in #101/#102/#104, now merged. ## The reference The root `Cargo.toml` is the policy source; the two copies and the xtask check keep the fork's workspaces in sync with it. ## Evidence - `cargo check --workspace --all-targets --locked` clean in both `greenfield/` and `greenfield/wine/` with the deny inherited. - Root tests (240 + xtask 6), greenfield library tests (11 + 16 + 151) and policy (6) pass; `tools/build.sh` succeeds. ## Checklist (docs/AGENTS.md) - [x] One topic; `docs/TASKS.md` not edited (rule 29/31) - [x] No fallback added (rule 33) - [x] No constants or switches added (rules 2/9b) - [x] No queues changed (rule 35) - [x] Narrow unsafe blocks with SAFETY notes (rule 36) - [x] Check, build and tests pass; no translator output change (rule 27) - [x] Comments say what is true now (rule 3) - [x] Nothing from the title, no non-free data pointers (hard constraints)
Finish #41: both workspaces now carry the root's [workspace.lints.rust] table
(unsafe_op_in_unsafe_fn, unused_must_use), xtask's lint_tables_match checks it
alongside clippy, and the unsafe operations in test/bin targets have narrow
blocks with SAFETY notes. All crate-level sites were done in #101/#102/#104.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 14:18:58 +00:00
Reviewer follow-up for the lint tables PR: the test helpers regressed to
whole-body unsafe blocks. Make them plain fns with one narrow block per Vulkan
/libc call and a SAFETY note for that call (rule 36); the one-operation rd/wr
helpers stay as they are.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 14:19 UTC · original

Thanks, the table part and the xtask check are exactly right, and the one-line rd/wr helpers are fine as they are (one operation each).

One thing before it can merge: five test-harness functions went back to the whole-body shape from #94/#95, { unsafe { … }} around the full body:

  • umem/tests/identity_probe.rs: alloc_at (25 lines), free
  • umem/tests/sparse_probe.rs: sparse_buffer, bind
  • umem/tests/sparse_speed.rs: pipe

Test code follows the same rule (rule 36), so please give them the #101 treatment: a /// # Safety section for the caller's contract instead of the // SAFETY: line above the fn, and narrow blocks with a reason each. In alloc_at the reasons can be short ("info's chain lives until the call returns", "buf and mem are this device's and unbound"). Alternatively, if a function has no real precondition for its caller, make it a plain fn with narrow blocks inside; that's often the cleaner fix for test helpers.

Everything else is ready; I'll merge as soon as those five are done (please push to this branch, no re-open).

**@⁠vktory6** on GitHub · 2026-12-01 14:19 UTC · [original](https://github.com/vktory6/VKtory/pull/108#issuecomment-7314070916) Thanks, the table part and the xtask check are exactly right, and the one-line `rd`/`wr` helpers are fine as they are (one operation each). One thing before it can merge: five test-harness functions went back to the whole-body shape from #94/#95, `{ unsafe { … }}` around the full body: - `umem/tests/identity_probe.rs`: `alloc_at` (25 lines), `free` - `umem/tests/sparse_probe.rs`: `sparse_buffer`, `bind` - `umem/tests/sparse_speed.rs`: `pipe` Test code follows the same rule (rule 36), so please give them the #101 treatment: a `/// # Safety` section for the caller's contract instead of the `// SAFETY:` line above the `fn`, and narrow blocks with a reason each. In `alloc_at` the reasons can be short ("`info`'s chain lives until the call returns", "`buf` and `mem` are this device's and unbound"). Alternatively, if a function has no real precondition for its caller, make it a plain `fn` with narrow blocks inside; that's often the cleaner fix for test helpers. Everything else is ready; I'll merge as soon as those five are done (please push to this branch, no re-open).
github-bot changed target branch from main to gh-pr/108/base 2026-12-01 14:29:44 +00:00
github manually merged commit 0a2dcc01ff into gh-pr/108/base 2026-12-01 14:29:47 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 14:30 UTC · original

Merged as 4447bb9, thanks! Plain functions with narrow blocks were the right call for those helpers. That finishes #41's lint work.

**@⁠vktory6** on GitHub · 2026-12-01 14:30 UTC · [original](https://github.com/vktory6/VKtory/pull/108#issuecomment-7314368672) Merged as 4447bb9, thanks! Plain functions with narrow blocks were the right call for those helpers. That finishes #41's lint work.
This discussion has been locked. Commenting is limited to contributors.
No description provided.