Skip to content

Commit af3ef52

Browse files
SSheldonOsspial
authored andcommitted
Fix so the compiler can infer msg_send! return types (#1227)
* Fix so the compiler can infer msg_send! return type Currently, due to a quirk in Rust's type inference interacting with the structure of the msg_send! macro, a () return type will be inferred when the compiler cannot otherwise determine the return type. This behavior is expected to change, and in the future could resolve to a ! return type, which results in undefined behavior. Linting has previously been added for this in rust-lang/rust#39216, but it did not catch these cases due to SSheldon/rust-objc#62. An upcoming version of objc will be fixed to stop hiding these errors, at which point they will become compile errors. This change fixes these errors and allows winit to compile with the fixed version of objc. * Bump cocoa to 0.19.1
1 parent 2b5f9c5 commit af3ef52

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ version = "0.2"
3737
objc = "0.2.3"
3838

3939
[target.'cfg(target_os = "macos")'.dependencies]
40-
cocoa = "0.18.4"
40+
cocoa = "0.19.1"
4141
core-foundation = "0.6"
4242
core-graphics = "0.17.3"
4343
dispatch = "0.1.4"

src/platform_impl/macos/window.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ impl UnownedWindow {
786786
// of the menu bar, and this looks broken, so we must make sure
787787
// that the menu bar is disabled. This is done in the window
788788
// delegate in `window:willUseFullScreenPresentationOptions:`.
789-
msg_send![*self.ns_window, setLevel: ffi::CGShieldingWindowLevel() + 1];
789+
let () = msg_send![*self.ns_window, setLevel: ffi::CGShieldingWindowLevel() + 1];
790790
},
791791
(
792792
&Some(Fullscreen::Exclusive(RootVideoMode { ref video_mode })),

0 commit comments

Comments
 (0)