Skip to content

Commit

Permalink
Fix so the compiler can infer msg_send! return type
Browse files Browse the repository at this point in the history
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. objc has been
fixed to stop hiding these errors as of version 0.2.7, and they are now
compile errors.

This change fixes these errors and allows compiling with the
latest version of objc.
  • Loading branch information
SSheldon authored and jdm committed Oct 19, 2019
1 parent 72803b7 commit 1b9c747
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform/with_eagl/native_gl_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl NativeGLContext {
impl Drop for NativeGLContext {
fn drop(&mut self) {
unsafe {
msg_send![self.0, release];
let () = msg_send![self.0, release];
}
}
}
Expand Down

0 comments on commit 1b9c747

Please sign in to comment.