mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11: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:
parent
51181b4347
commit
559681b0ed
|
@ -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)];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue