Skip to content

Commit 1b9c747

Browse files
SSheldonjdm
authored andcommitted
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. 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.
1 parent 72803b7 commit 1b9c747

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/platform/with_eagl/native_gl_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl NativeGLContext {
3434
impl Drop for NativeGLContext {
3535
fn drop(&mut self) {
3636
unsafe {
37-
msg_send![self.0, release];
37+
let () = msg_send![self.0, release];
3838
}
3939
}
4040
}

0 commit comments

Comments
 (0)