Skip to content

Require Send + Sync for windows-reference boxing - #5482

Merged
Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
reference-result-ownership
Nov 24, 2026
Merged

Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
reference-result-ownership

Conversation

@kennykerr

Copy link
Copy Markdown
Collaborator

Require Send + Sync for stock IReference<T> boxing. Native consumers remain unrestricted; Reactor's boxing helper gets matching bounds.

Part of #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.

🟢 Approval recommended

No active review issues block the changes to stock-reference boxing and native-reference consumption.

No open issues 🎉

What changed in this PR

This PR addresses part of #5469 by requiring Send + Sync when boxing values into stock
IReference<T> objects, while leaving consumption of existing native references unrestricted.

Changes:

  • Add thread-safety bounds to stock reference boxing and Reactor's matching helper.
  • Add compile-fail coverage for non-thread-safe values and a generic native-consumer test.
  • Document the distinction between boxing and reading native references.

Verification was limited to a standalone Rust lifetime check; Windows tests were not run.

File Description
crates/​tests/​libs/​reference/​tests/​stock_reference.rs Tests consumption without Send + Sync bounds.
crates/​tests/​libs/​reference/​src/​lib.rs Adds compile-fail cases for missing Send or Sync.
crates/​tests/​libs/​reference/​Cargo.toml Enables doctests for the compile-fail cases.
crates/​libs/​reference/​src/​reference.rs Requires Send + Sync for stock boxing.
crates/​libs/​reference/​readme.md Documents boxing-only thread-safety requirements.
crates/​libs/​reactor/​src/​native/​winui/​dependency.rs Aligns Reactor's boxing helper bounds.

Review effort: Balanced

@kennykerr
Kenny Kerr (kennykerr) merged commit 23143d1 into master Nov 24, 2026
51 checks passed
@kennykerr
Kenny Kerr (kennykerr) deleted the reference-result-ownership branch November 24, 2026 14:03
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