[macOS] Fix crashes due to the stabilization of the ! (never) type (#428)

Due to the recent changes in the Rust compiler, unconstrained type
variables are now deduced to `!` instead of `()`. There are some
occurrences where `msg_send!` is used without constraining its return
type (relying on the assumption that they would be deduced to be `()`).
As a result, the macOS port of winit stopped working.

This PR fixes this issue (#426) by adding explicit return types to
such uses of `msg_send!`.
This commit is contained in:
YVT 2018-03-22 04:36:06 +09:00 committed by Pierre Krieger
parent 51181b4347
commit 559681b0ed

View file

@ -278,7 +278,7 @@ impl Drop for Window2 {
let nswindow = *self.window;
if nswindow != nil {
unsafe {
msg_send![nswindow, close];
let () = msg_send![nswindow, close];
}
}
}
@ -346,7 +346,7 @@ impl Window2 {
use cocoa::foundation::NSArray;
// register for drag and drop operations.
msg_send![(*window as id),
let () = msg_send![(*window as id),
registerForDraggedTypes:NSArray::arrayWithObject(nil, appkit::NSFilenamesPboardType)];
}