Skip to content

Add clippy::semicolon_if_nothing_returned workspace lint - #4427

Merged
Kenny Kerr (kennykerr) merged 3 commits into
masterfrom
copilot/add-clippy-lint-update-all-crates
May 18, 2026
Merged

Add clippy::semicolon_if_nothing_returned workspace lint#4427
Kenny Kerr (kennykerr) merged 3 commits into
masterfrom
copilot/add-clippy-lint-update-all-crates

Conversation

Copilot AI commented May 18, 2026

Copy link
Copy Markdown
Contributor

Adds clippy::semicolon_if_nothing_returned = "warn" to the root workspace's [workspace.lints.clippy] and updates all crates — including the code generated by windows-bindgen — to comply.

Changes

Workspace

  • Cargo.toml: add the new [workspace.lints.clippy] section.

windows-bindgen generator

  • types/enum.rs, types/cpp_enum.rs: emit trailing ; in BitOrAssign/BitAndAssign bodies.
  • types/cpp_method.rs:
    • write_upcall ReturnStruct arm: emit trailing ; after the out-pointer write.
    • write_upcall catch-all arm: emit trailing ; when the impl method returns Void (so the void thunk doesn't trigger the lint), otherwise leave the trailing-expression form (HRESULT / value pass-through).
    • write ReturnHint::None arm: emit trailing ; inside the vtable wrapper when the wrapper itself returns unit (avoids the lint on long, multi-line argument lists that rustfmt breaks).

Regenerated content (via cargo run -p tool_bindings and cargo test -p test_bindgen)

  • All crates/libs/windows/src/Windows/**/mod.rs files.
  • crates/tests/libs/bindgen/data/bindgen/*/expected.rs goldens.

Hand-written fixes in crates the bindgen regen doesn't cover:

  • windows-bindgen, windows-metadata, windows-rdl, windows-result, windows-strings.
  • Samples: direct3d12, privileges.
  • Tests: threading::pool, implement_core::com_object, weak_ref::race, win32::winsock.
  • Pre-committed bindings.rs files in crates/tests/misc/component*, crates/samples/windows/webview, and crates/libs/metadata/src/attributes.rs.

Validation

  • cargo clippy --workspace --tests --target x86_64-pc-windows-gnu -- -D warnings clean (using the same --exclude windows_*_{msvc,gnu,gnullvm} filter the existing cross-target workflow uses; CI's native cargo clippy --all --tests -- -D warnings on windows-2025 runs the same lint set).
  • cargo fmt --all --check clean.
  • cargo test -p test_bindgen -p windows-bindgen -p windows-metadata -p windows-rdl passing (324 fixture tests + downstream).
  • cargo run -p tool_bindings, tool_workspace, tool_yml produce no further diff.

Copilot AI and others added 2 commits May 18, 2026 17:11
@kennykerr
Kenny Kerr (kennykerr) marked this pull request as ready for review May 18, 2026 18:20
@kennykerr
Kenny Kerr (kennykerr) merged commit fafb5f7 into master May 18, 2026
29 checks passed
@kennykerr
Kenny Kerr (kennykerr) deleted the copilot/add-clippy-lint-update-all-crates branch May 18, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants