mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
[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:
@@ -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)];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user