Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

Commit

Permalink
Add explicit () return types for msg_send!
Browse files Browse the repository at this point in the history
`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 (rust-lang/rust#48950),
and it'll be deduced to be `!`.

This commit adds explicit return types to preserve the old behavior.
  • Loading branch information
yvt committed Mar 21, 2018
1 parent e6e2e30 commit 13ca2ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}

Expand All @@ -304,7 +304,7 @@ impl CAMetalLayer {

pub fn remove_all_animations(&self) {
unsafe {
msg_send![self.0, removeAllAnimations];
msg_send![self.0, removeAllAnimations]
}
}

Expand Down
2 changes: 1 addition & 1 deletion NGSEngine/src/ngsgfx/src/wsi/metal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}

Expand All @@ -304,7 +304,7 @@ impl CAMetalLayer {

pub fn remove_all_animations(&self) {
unsafe {
msg_send![self.0, removeAllAnimations];
msg_send![self.0, removeAllAnimations]
}
}

Expand Down

0 comments on commit 13ca2ee

Please sign in to comment.