greenfield and greenfield/wine do not apply the root workspace's rustc lints #41

Closed
opened 2026-12-01 04:00:20 +00:00 by github-bot · 4 comments
Owner

@⁠Mhyster on GitHub · 2026-12-01 03:59 UTC · original

The root denies unsafe_op_in_unsafe_fn and unused_must_use; the two other workspaces only carry the clippy table. Turning on unsafe_op_in_unsafe_fn = "deny" there reports ~95 unsafe operations inside unsafe fn bodies without their own unsafe {} block (and SAFETY note), most in the wine crates (umem-unix, umem-pe, vkback-unix). Wrapping them is mechanical; then the [workspace.lints.rust] table can be copied too and added to xtask's lint_tables_match.

Seen on: 2dd59da (with the lint switched on locally).

🤖 Generated with Claude Code

**@⁠Mhyster** on GitHub · 2026-12-01 03:59 UTC · [original](https://github.com/vktory6/VKtory/issues/41) The root denies `unsafe_op_in_unsafe_fn` and `unused_must_use`; the two other workspaces only carry the clippy table. Turning on `unsafe_op_in_unsafe_fn = "deny"` there reports ~95 unsafe operations inside `unsafe fn` bodies without their own `unsafe {}` block (and SAFETY note), most in the wine crates (umem-unix, umem-pe, vkback-unix). Wrapping them is mechanical; then the `[workspace.lints.rust]` table can be copied too and added to xtask's `lint_tables_match`. Seen on: 2dd59da (with the lint switched on locally). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 04:00:20 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 07:34 UTC · original

Thanks! I created a task based on your report: "The root workspace's rustc lints everywhere" in github.com/vktory6/VKtory@5169307. Once it's done, the rustc table joins lint_tables_match from #46.

**@⁠vktory6** on GitHub · 2026-12-01 07:34 UTC · [original](https://github.com/vktory6/VKtory/issues/41#issuecomment-7304232774) Thanks! I created a task based on your report: "The root workspace's rustc lints everywhere" in https://github.com/vktory6/VKtory/commit/5169307. Once it's done, the rustc table joins `lint_tables_match` from #46.
Author
Owner

@⁠TheRifai on GitHub · 2026-12-01 09:04 UTC · original

Scope note from an attempted pass, in case it helps whoever picks this up:

Adding [workspace.lints.rust] (the root table: unsafe_op_in_unsafe_fn = "deny", unused_must_use = "deny") to greenfield/Cargo.toml and greenfield/wine/Cargo.toml, plus [lints] workspace = true in the seven greenfield member manifests, reports roughly 95 E0133 sites: about 39 in umem (bindlog.rs, lookup.rs, binds.rs, mapping.rs, lib.rs), then vkback/frame, and ~16 in the wine crates (mostly umem-pe/src/lib.rs).

A mass unsafe { ... } wrap would be a hack (rule 23), and wrapping a let statement's whole body would change variable scope, so I did not ship the scripted version. The work is mechanical but wants a real SAFETY note per site. Starting with umem and compiling after each file is the safest order.

No PR was opened; working tree was restored.

**@⁠TheRifai** on GitHub · 2026-12-01 09:04 UTC · [original](https://github.com/vktory6/VKtory/issues/41#issuecomment-7306175098) Scope note from an attempted pass, in case it helps whoever picks this up: Adding `[workspace.lints.rust]` (the root table: `unsafe_op_in_unsafe_fn = "deny"`, `unused_must_use = "deny"`) to `greenfield/Cargo.toml` and `greenfield/wine/Cargo.toml`, plus `[lints] workspace = true` in the seven greenfield member manifests, reports roughly 95 E0133 sites: about 39 in `umem` (bindlog.rs, lookup.rs, binds.rs, mapping.rs, lib.rs), then vkback/frame, and ~16 in the wine crates (mostly `umem-pe/src/lib.rs`). A mass `unsafe { ... }` wrap would be a hack (rule 23), and wrapping a `let` statement's whole body would change variable scope, so I did not ship the scripted version. The work is mechanical but wants a real SAFETY note per site. Starting with `umem` and compiling after each file is the safest order. No PR was opened; working tree was restored.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 09:08 UTC · original

Thanks, agreed: no scripted wrap, a SAFETY note per site, file by file starting with umem. It's in the task now (github.com/vktory6/VKtory@a2d52e2).

**@⁠vktory6** on GitHub · 2026-12-01 09:08 UTC · [original](https://github.com/vktory6/VKtory/issues/41#issuecomment-7306268193) Thanks, agreed: no scripted wrap, a SAFETY note per site, file by file starting with umem. It's in the task now (https://github.com/vktory6/VKtory/commit/a2d52e2).
Author
Owner

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

Done: all workspaces now deny unsafe_op_in_unsafe_fn and unused_must_use like the root, every unsafe operation has its own block and SAFETY note, and xtask's lint_tables_match checks both tables. Merged in #101, #102, #104 and #108 (thanks to TheRifai); the task is closed in github.com/vktory6/VKtory@6b7f1d8. Closing.

**@⁠vktory6** on GitHub · 2026-12-01 14:32 UTC · [original](https://github.com/vktory6/VKtory/issues/41#issuecomment-7314439096) Done: all workspaces now deny `unsafe_op_in_unsafe_fn` and `unused_must_use` like the root, every unsafe operation has its own block and SAFETY note, and xtask's `lint_tables_match` checks both tables. Merged in #101, #102, #104 and #108 (thanks to TheRifai); the task is closed in https://github.com/vktory6/VKtory/commit/6b7f1d8. Closing.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/vktory6--VKtory#41
No description provided.