Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async test return values aren't Sendable, so tests fail to compile #311

Open
colinmarc opened this issue Jan 27, 2025 · 0 comments · May be fixed by #312
Open

Async test return values aren't Sendable, so tests fail to compile #311

colinmarc opened this issue Jan 27, 2025 · 0 comments · May be fixed by #312

Comments

@colinmarc
Copy link

In the async tests, several of the tests return structs that aren't declared Sendable:

async fn rust_async_return_struct() -> AsyncRustFnReturnStruct;

This is an error in swift 6:

/home/colinmarc/dev/swift-bridge/integration-tests/Sources/SharedLib/Generated/SharedLib.swift:4135:26: error: sending 'rustFnRetVal' risks causing data races
4133 |     return await withCheckedContinuation({ (continuation: CheckedContinuation<RustString, Never>) in
4134 |         let callback = { rustFnRetVal in
4135 |             continuation.resume(with: rustFnRetVal)
     |                          |- error: sending 'rustFnRetVal' risks causing data races
     |                          `- note: task-isolated 'rustFnRetVal' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
4136 |         }
4137 |

See also #269, #288, #280, #310.

@colinmarc colinmarc linked a pull request Jan 27, 2025 that will close this issue
colinmarc added a commit to colinmarc/swift-bridge that referenced this issue Jan 27, 2025
colinmarc added a commit to colinmarc/swift-bridge that referenced this issue Feb 2, 2025
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 a pull request may close this issue.

1 participant