Skip to content

Require Send and Sync for COM implementations - #5503

Merged
Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
com-send-sync-enforcement
Nov 26, 2026
Merged

Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
com-send-sync-enforcement

Conversation

@kennykerr

@kennykerr Kenny Kerr (kennykerr) commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Both COM implementation macros now require Send + Sync, including non-agile implementations and static storage. Adds compile-fail examples for each missing bound.

Builds on the preparation in #5480, #5482, #5485, #5487, #5489, #5494, #5495, #5497, and #5501.

Fixes #5469.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The source-breaking threading bound affects every generated COM owner, but workspace compilation and compile-fail doctests were not run, leaving supported Windows configurations unverified.

No open issues 🎉

What changed in this PR

This PR closes #5469 by requiring Send + Sync for COM implementations through IUnknownImpl, following the preparatory ownership changes across the codebase.

Changes:

  • Enforces both bounds for both COM implementation macros, including non-agile implementations and static storage.
  • Documents the threading requirements and adds compile-fail examples for unsupported implementations.
  • Introduces a source-breaking restriction for implementations that lack either bound.
File Description
crates/​libs/​implement/​src/​lib.rs Documents threading requirements and adds separate missing-bound examples.
crates/​libs/​core/​src/​unknown.rs Adds Send + Sync supertraits to IUnknownImpl.
crates/​libs/​core/​src/​implement_macro.rs Documents declarative macro requirements and adds a compile-fail example.

Review effort: Balanced

@kennykerr
Kenny Kerr (kennykerr) merged commit 4f854dd into master Nov 26, 2026
51 checks passed
@kennykerr
Kenny Kerr (kennykerr) deleted the com-send-sync-enforcement branch November 26, 2026 01: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.

#[implement] doesn't require Send + Sync, so safe code can race on a !Sync implementation

2 participants