From 7dbbbf6607ebf14240f19580d3485e8a425c3b26 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Thu, 23 Nov 2017 14:17:56 +0200 Subject: [PATCH] fix NetBSD --- src/libstd/net/ip.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index eea604943af..c832f8a934d 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -719,7 +719,8 @@ impl Eq for Ipv4Addr {} #[stable(feature = "rust1", since = "1.0.0")] impl hash::Hash for Ipv4Addr { fn hash(&self, s: &mut H) { - self.inner.s_addr.hash(s) + // `inner` is #[repr(packed)], so we need to copy `s_addr`. + {self.inner.s_addr}.hash(s) } }