From 13ca2ee778a0ff4c7cb08f110f3184a62474be19 Mon Sep 17 00:00:00 2001 From: yvt Date: Thu, 22 Mar 2018 01:12:44 +0900 Subject: [PATCH] Add explicit `()` return types for msg_send! `msg_send!` with an unconstrained return type used to be deduced to have the return type `()`. This is no longer the case after the stabilization of the `!` (never) type (https://github.com/rust-lang/rust/issues/48950), and it'll be deduced to be `!`. This commit adds explicit return types to preserve the old behavior. --- .../src/ngsgfx/src/backend/metal/src/metal-rs/src/lib.rs | 6 +++--- NGSEngine/src/ngsgfx/src/wsi/metal/src/lib.rs | 2 +- .../src/zangfx/src/backend/metal/src/metal-rs/src/lib.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/NGSEngine/src/ngsgfx/src/backend/metal/src/metal-rs/src/lib.rs b/NGSEngine/src/ngsgfx/src/backend/metal/src/metal-rs/src/lib.rs index 0aa723e2..88a6201a 100644 --- a/NGSEngine/src/ngsgfx/src/backend/metal/src/metal-rs/src/lib.rs +++ b/NGSEngine/src/ngsgfx/src/backend/metal/src/metal-rs/src/lib.rs @@ -274,13 +274,13 @@ impl CAMetalLayer { pub fn set_presents_with_transaction(&self, transaction: bool) { unsafe { - msg_send![self.0, setPresentsWithTransaction:transaction]; + msg_send![self.0, setPresentsWithTransaction:transaction] } } pub fn set_framebuffer_only(&self, framebuffer_only: bool) { unsafe { - msg_send![self.0, setFramebufferOnly:framebuffer_only]; + msg_send![self.0, setFramebufferOnly:framebuffer_only] } } @@ -304,7 +304,7 @@ impl CAMetalLayer { pub fn remove_all_animations(&self) { unsafe { - msg_send![self.0, removeAllAnimations]; + msg_send![self.0, removeAllAnimations] } } diff --git a/NGSEngine/src/ngsgfx/src/wsi/metal/src/lib.rs b/NGSEngine/src/ngsgfx/src/wsi/metal/src/lib.rs index e275e6de..8861df61 100644 --- a/NGSEngine/src/ngsgfx/src/wsi/metal/src/lib.rs +++ b/NGSEngine/src/ngsgfx/src/wsi/metal/src/lib.rs @@ -233,7 +233,7 @@ impl wsi_core::NewWindow for MetalWindow { let ns_cs_name = NSString::alloc(ptr::null_mut()).init_str(cs_name); let colorspace = CGColorSpaceCreateWithName(mem::transmute(ns_cs_name)); - msg_send![ns_cs_name, release]; + let () = msg_send![ns_cs_name, release]; layer.set_edge_antialiasing_mask(0); layer.set_masks_to_bounds(true); diff --git a/NGSEngine/src/zangfx/src/backend/metal/src/metal-rs/src/lib.rs b/NGSEngine/src/zangfx/src/backend/metal/src/metal-rs/src/lib.rs index 2af6f5bd..e2707733 100644 --- a/NGSEngine/src/zangfx/src/backend/metal/src/metal-rs/src/lib.rs +++ b/NGSEngine/src/zangfx/src/backend/metal/src/metal-rs/src/lib.rs @@ -274,13 +274,13 @@ impl CAMetalLayer { pub fn set_presents_with_transaction(&self, transaction: bool) { unsafe { - msg_send![self.0, setPresentsWithTransaction:transaction]; + msg_send![self.0, setPresentsWithTransaction:transaction] } } pub fn set_framebuffer_only(&self, framebuffer_only: bool) { unsafe { - msg_send![self.0, setFramebufferOnly:framebuffer_only]; + msg_send![self.0, setFramebufferOnly:framebuffer_only] } } @@ -304,7 +304,7 @@ impl CAMetalLayer { pub fn remove_all_animations(&self) { unsafe { - msg_send![self.0, removeAllAnimations]; + msg_send![self.0, removeAllAnimations] } }