macOS/iOS: Fix auto trait impls of EventLoopProxy#1084
Merged
goddessfreya merged 6 commits intorust-windowing:masterfrom Aug 9, 2019
yvt:patch-unsafe-proxy
Merged
macOS/iOS: Fix auto trait impls of EventLoopProxy#1084goddessfreya merged 6 commits intorust-windowing:masterfrom yvt:patch-unsafe-proxy
EventLoopProxy#1084goddessfreya merged 6 commits intorust-windowing:masterfrom
yvt:patch-unsafe-proxy
Conversation
`EventLoopProxy<T>` allows sending `T` from an arbitrary thread that owns the proxy object. Thus, if `T` is `!Send`, `EventLoopProxy<T>` must not be allowed to leave the main thread. `EventLoopProxy<T>` uses `std::sync::mpsc::Sender` under the hood, meaning the `!Sync` restriction of it also applies to `EventLoopProxy<T>`. That is, even if `T` is thread-safe, a single `EventLoopProxy` object cannot be shared between threads.
Contributor
|
Nice catch! This breaks our build (for good reasons), but unfortunately there's no great workaround because the |
Contributor
|
Needs a changelog entry, then lgtm. |
Contributor
Author
Contributor
Author
|
Added a changelog entry. |
Contributor
|
Thanks! |
mtak-
approved these changes
Aug 5, 2019
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.
This pull request fixes
EventLoopProxy<T>'s auto trait implementations.EventLoopProxy<T>: Sendonly ifT: Send, because otherwise it would allow sending unsendable objects.EventLoopProxy<T>: !Syncbecause ofstd::sync::mpsc::Senderused under the hood. This restriction is congruent with other platforms'EventLoopProxy.cargo fmthas been run on this branchCHANGELOG.mdif knowledge of this change could be valuable to users