From 559681b0ed35100ad8418e09e4f35873caa33d7b Mon Sep 17 00:00:00 2001 From: YVT Date: Thu, 22 Mar 2018 04:36:06 +0900 Subject: [PATCH] [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!`. --- src/platform/macos/window.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/macos/window.rs b/src/platform/macos/window.rs index 9a09c040..aa409c71 100644 --- a/src/platform/macos/window.rs +++ b/src/platform/macos/window.rs @@ -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)]; }