Skip to content

Commit 7dbbbf6

Browse files
arielb1Ariel Ben-Yehuda
authored and
Ariel Ben-Yehuda
committed
fix NetBSD
1 parent 617b413 commit 7dbbbf6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libstd/net/ip.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,8 @@ impl Eq for Ipv4Addr {}
719719
#[stable(feature = "rust1", since = "1.0.0")]
720720
impl hash::Hash for Ipv4Addr {
721721
fn hash<H: hash::Hasher>(&self, s: &mut H) {
722-
self.inner.s_addr.hash(s)
722+
// `inner` is #[repr(packed)], so we need to copy `s_addr`.
723+
{self.inner.s_addr}.hash(s)
723724
}
724725
}
725726

0 commit comments

Comments
 (0)