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

Introduce UncheckedSendable type for wrapping non-sendable types #806

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

marcosgriselli
Copy link
Contributor

@marcosgriselli marcosgriselli commented Feb 9, 2024

Fixes #805

Introduce an UncheckedSendable type for wrapping non-sendable types in a @Sendable context.

More context on why unsafe pointer types are no longer Sendable: https://forums.swift.org/t/unsafepointer-sendable-should-be-revoked/51926

The change was merged some time ago and only the warning is new in Xcode 15.3 betas so the behavior shouldn't be affected by this change.

extension UnsafeMutablePointer: @unchecked Sendable {} would've also silenced the warning but would go against the points made in the forums discussion. Keeping the UncheckedSendable wrapper forces to acknowledge the context and solution.

Open to try different approaches but this is the one I'm familiar with.

Copy link
Owner

@jpsim jpsim left a comment

Choose a reason for hiding this comment

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

I agree with your proposed fix. Can you please rebase now that CI should be passing again?

Signed-off-by: Marcos Griselli <marcosg@lyft.com>
@marcosgriselli
Copy link
Contributor Author

Done!

@jpsim
Copy link
Owner

jpsim commented Feb 27, 2024

Thank you!

@jpsim jpsim merged commit 01ad530 into jpsim:main Feb 27, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants