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 musl build by letting Rust infer the correct type for SIOCGIFMTU #60

Merged
merged 1 commit into from
Apr 2, 2019

Conversation

vkrasnov
Copy link
Contributor

@vkrasnov vkrasnov commented Apr 1, 2019

Fixes #47

@Lekensteyn
Copy link

Lekensteyn commented Apr 1, 2019

I guess that this is similar to casting a pointer to void* in C?

Do you happen to have a reference for how this works? I can't find the _ case here:
https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions

@vkrasnov
Copy link
Contributor Author

vkrasnov commented Apr 1, 2019

I guess that this is similar to casting a pointer to void* in C?

Only where pointer is expected. In this case it just coerces the integer to the correct bitwidth (something that C does automatically)

https://doc.rust-lang.org/reference/type-coercions.html
https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions

@vkrasnov vkrasnov requested a review from Lekensteyn April 1, 2019 16:28
@Lekensteyn
Copy link

Ok, so apparently this is the "inferred type" which is documented here:
https://doc.rust-lang.org/reference/types/inferred.html

The change looks good to me, but perhaps you could clarify the commit message?

Copy link
Contributor

@ashleygwilliams ashleygwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay i can make the binaries for the musl now! thank u :)

@vkrasnov vkrasnov changed the title Fix musl build Fix musl build by letting Rust infer the correct type for SIOCGIFMTU Apr 2, 2019
@vkrasnov vkrasnov merged commit 1f842a6 into master Apr 2, 2019
@vkrasnov vkrasnov deleted the musl branch April 4, 2020 11:07
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.

3 participants