macOS/iOS: Fix auto trait impls of EventLoopProxy (#1084)

* macOS/iOS: Fix auto trait impls of `EventLoopProxy`

`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.

* Update `CHANGELOG.md`
This commit is contained in:
YVT 2019-08-09 09:13:14 +09:00 committed by Hal Gentz
parent 30b4f8dc9f
commit 31ada5a052
3 changed files with 4 additions and 5 deletions

View file

@ -21,7 +21,8 @@
- On Linux, the functions `is_wayland`, `is_x11`, `xlib_xconnection` and `wayland_display` have been moved to a new `EventLoopWindowTargetExtUnix` trait. - On Linux, the functions `is_wayland`, `is_x11`, `xlib_xconnection` and `wayland_display` have been moved to a new `EventLoopWindowTargetExtUnix` trait.
- On iOS, add `set_prefers_status_bar_hidden` extension function instead of - On iOS, add `set_prefers_status_bar_hidden` extension function instead of
hijacking `set_decorations` for this purpose. hijacking `set_decorations` for this purpose.
- On macOS and iOS, corrected the auto trait impls of `EventLoopProxy`.
# 0.20.0 Alpha 2 (2019-07-09) # 0.20.0 Alpha 2 (2019-07-09)
- On X11, non-resizable windows now have maximize explicitly disabled. - On X11, non-resizable windows now have maximize explicitly disabled.

View file

@ -142,8 +142,7 @@ pub struct EventLoopProxy<T> {
source: CFRunLoopSourceRef, source: CFRunLoopSourceRef,
} }
unsafe impl<T> Send for EventLoopProxy<T> {} unsafe impl<T: Send> Send for EventLoopProxy<T> {}
unsafe impl<T> Sync for EventLoopProxy<T> {}
impl<T> Clone for EventLoopProxy<T> { impl<T> Clone for EventLoopProxy<T> {
fn clone(&self) -> EventLoopProxy<T> { fn clone(&self) -> EventLoopProxy<T> {

View file

@ -113,8 +113,7 @@ pub struct Proxy<T> {
source: CFRunLoopSourceRef, source: CFRunLoopSourceRef,
} }
unsafe impl<T> Send for Proxy<T> {} unsafe impl<T: Send> Send for Proxy<T> {}
unsafe impl<T> Sync for Proxy<T> {}
impl<T> Clone for Proxy<T> { impl<T> Clone for Proxy<T> {
fn clone(&self) -> Self { fn clone(&self) -> Self {