Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix so the compiler can infer msg_send! return type #150

Merged
merged 1 commit into from
Oct 19, 2019
Merged

Fix so the compiler can infer msg_send! return type #150

merged 1 commit into from
Oct 19, 2019

Conversation

SSheldon
Copy link

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.

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.
@jdm
Copy link
Member

jdm commented Oct 19, 2019

@bors-servo r+

@jdm jdm merged commit 1b9c747 into servo:master Oct 19, 2019
@SSheldon SSheldon deleted the fix_omitted_ret_types branch October 19, 2019 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants