Add clippy::semicolon_if_nothing_returned workspace lint - #4427
Merged
Kenny Kerr (kennykerr) merged 3 commits intoMay 18, 2026
Conversation
…atterns Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/56f69433-d51f-41ea-bf58-11d7e65d88ec Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
…d warnings Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/56f69433-d51f-41ea-bf58-11d7e65d88ec Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Kenny Kerr (kennykerr)
May 18, 2026 17:41
View session
Kenny Kerr (kennykerr)
marked this pull request as ready for review
May 18, 2026 18:20
Kenny Kerr (kennykerr)
deleted the
copilot/add-clippy-lint-update-all-crates
branch
May 18, 2026 18:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
clippy::semicolon_if_nothing_returned = "warn"to the root workspace's[workspace.lints.clippy]and updates all crates — including the code generated bywindows-bindgen— to comply.Changes
Workspace
Cargo.toml: add the new[workspace.lints.clippy]section.windows-bindgengeneratortypes/enum.rs,types/cpp_enum.rs: emit trailing;inBitOrAssign/BitAndAssignbodies.types/cpp_method.rs:write_upcallReturnStructarm: emit trailing;after the out-pointer write.write_upcallcatch-all arm: emit trailing;when the impl method returnsVoid(so the void thunk doesn't trigger the lint), otherwise leave the trailing-expression form (HRESULT / value pass-through).writeReturnHint::Nonearm: 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_bindingsandcargo test -p test_bindgen)crates/libs/windows/src/Windows/**/mod.rsfiles.crates/tests/libs/bindgen/data/bindgen/*/expected.rsgoldens.Hand-written fixes in crates the bindgen regen doesn't cover:
windows-bindgen,windows-metadata,windows-rdl,windows-result,windows-strings.direct3d12,privileges.threading::pool,implement_core::com_object,weak_ref::race,win32::winsock.bindings.rsfiles incrates/tests/misc/component*,crates/samples/windows/webview, andcrates/libs/metadata/src/attributes.rs.Validation
cargo clippy --workspace --tests --target x86_64-pc-windows-gnu -- -D warningsclean (using the same--exclude windows_*_{msvc,gnu,gnullvm}filter the existing cross-target workflow uses; CI's nativecargo clippy --all --tests -- -D warningsonwindows-2025runs the same lint set).cargo fmt --all --checkclean.cargo test -p test_bindgen -p windows-bindgen -p windows-metadata -p windows-rdlpassing (324 fixture tests + downstream).cargo run -p tool_bindings,tool_workspace,tool_ymlproduce no further diff.