-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Manually implement extra traits for mq_attr
and sockaddr_nl
#1371
Conversation
The `pad` or `__reserved` fields are not always 0 on some platforms, so when used in the `PartialEq` implementation being used, fails some comparisons. This commit manually implements the extra traits to correct this behavior.
`nl_pad` field does not contain any actual data, so using it for comparison or hashing doesn't make sense. Instead manually implement extra traits ignoring this field.
r? @gnzlbg (rust_highfive has picked a reviewer for you, use r? to override) |
cc @asomers |
mq_attr
and sockaddr_nl
mq_attr
and sockaddr_nl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@bors: r+ We should probably just use "special" padding types that derive trivial implementations of the traits (e.g. |
📌 Commit 0b34501 has been approved by |
Manually implement extra traits for `mq_attr` and `sockaddr_nl` Avoid including padding fields in extra trait implementations as these fields aren't guaranteed to be 0 or some other sensible value. Closes #1302
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 0b34501 has been approved by |
Manually implement extra traits for `mq_attr` and `sockaddr_nl` Avoid including padding fields in extra trait implementations as these fields aren't guaranteed to be 0 or some other sensible value. Closes #1302
💔 Test failed - checks-travis |
@bors: retry |
Manually implement extra traits for `mq_attr` and `sockaddr_nl` Avoid including padding fields in extra trait implementations as these fields aren't guaranteed to be 0 or some other sensible value. Closes #1302
💔 Test failed - checks-cirrus-freebsd-11 |
☀️ Test successful - checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-travis, status-appveyor |
Avoid including padding fields in extra trait implementations as these fields aren't guaranteed to be 0 or some other sensible value.
Closes #1302