Repository navigation
Prepare COM test fixtures for Send and Sync - #5497
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The AgileReference retention and resolution paths still need Windows interop runtime validation, particularly for noexcept self-reference and identity cases, which compile checks alone do not establish.
No open issues 🎉
What changed in this PR
Prepares COM test fixtures for the proposed Send + Sync requirement in #5469. This is test-only work; it does not enable the requirement or change production crates.
Changes:
- Replace unsynchronized fixture state with atomics and locks, and add explicit generic bounds.
- Use thread-safe ownership for retained interfaces while preserving ABI and lifetime coverage.
- Add checks for iterator exhaustion, property type rejection, and retained interface identity.
| File | Description |
|---|---|
crates/tests/libs/interface_core/tests/macro_rules_decl.rs |
Add Send + Sync bounds to generic implementations. |
crates/tests/libs/implement/tests/vector.rs |
Separate checked and unsafe construction for retained values. |
crates/tests/libs/implement/tests/properties.rs |
Store synchronized integers and reject unsupported variant types. |
crates/tests/libs/implement/tests/into_impl.rs |
Synchronize iterator state and test exhausted GetMany calls. |
crates/tests/libs/implement/tests/data_object.rs |
Replace mutable call flags with atomics. |
crates/tests/libs/implement/tests/buffer.rs |
Protect buffer storage with a mutex. |
crates/tests/libs/implement_core/src/rust_generic.rs |
Add thread-safety bounds to the generic factory. |
crates/tests/libs/implement_core/src/com_object.rs |
Use an atomic fixture and assert thread-safe ownership. |
crates/tests/libs/core/tests/unknown.rs |
Track destruction through shared atomic counters. |
crates/tests/libs/bindgen/src/ownership_tests.rs |
Retain thread-safe delegates while preserving owning-result tests. |
crates/tests/libs/bindgen/src/lib.rs |
Use atomic lifetime tracking in borrowed-object coverage. |
crates/tests/libs/bindgen/src/com_results_tests.rs |
Synchronize provider modes and destruction counters. |
crates/tests/interop/fixtures/structs/component.rs |
Store interface-valued fields through agile references. |
crates/tests/interop/fixtures/structs/client.rs |
Assert retained interface identity. |
crates/tests/interop/fixtures/noexcept/component.rs |
Retain agile references and release replaced values outside locks. |
crates/tests/interop/fixtures/noexcept/client.rs |
Apply the same ownership pattern to the client fixture. |
crates/tests/interop/fixtures/native_factory/component.rs |
Store opaque handle values as integers. |
crates/tests/interop/fixtures/boxing/component.rs |
Retain boxed references through agile ownership. |
Review effort: Balanced
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.
Update COM implementation fixtures with synchronized state, explicit generic bounds, and thread-safe ownership of retained interfaces. Keep the existing ABI and lifetime coverage, including interface-valued results and collections.
Test-only preparation for #5469. The six affected packages were checked with the proposed Send + Sync bound, but this PR does not enable it or change production crates.