Skip to content

Commit

Permalink
[macOS] Fix crashes due to the stabilization of the ! (never) type (r…
Browse files Browse the repository at this point in the history
…ust-windowing#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 (rust-windowing#426) by adding explicit return types to
such uses of `msg_send!`.
  • Loading branch information
yvt authored and francesca64 committed Mar 23, 2018
1 parent 508f3f0 commit ed89ce6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platform/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
}
Expand Down Expand Up @@ -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)];
}

Expand Down

0 comments on commit ed89ce6

Please sign in to comment.