From 65b6485d8e8430792d154e3d0763744a91cd2c8e Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Thu, 6 Aug 2020 21:11:39 +0100 Subject: [PATCH] Work around #842634 on some machines, e.g. Debian porterboxes Forwarded: not-needed This should remain commented-out in debian/patches/series, it's not needed everywhere Forwarded: not-needed Gbp-Pq: Name d-host-duplicates.patch --- src/libstd/sys_common/net.rs | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/libstd/sys_common/net.rs b/src/libstd/sys_common/net.rs index 1c03bc9234..7cf89d7d3d 100644 --- a/src/libstd/sys_common/net.rs +++ b/src/libstd/sys_common/net.rs @@ -672,26 +672,3 @@ impl fmt::Debug for UdpSocket { res.field(name, &self.inner.as_inner()).finish() } } - -#[cfg(test)] -mod tests { - use super::*; - use crate::collections::HashMap; - - #[test] - fn no_lookup_host_duplicates() { - let mut addrs = HashMap::new(); - let lh = match LookupHost::try_from(("localhost", 0)) { - Ok(lh) => lh, - Err(e) => panic!("couldn't resolve `localhost': {}", e), - }; - for sa in lh { - *addrs.entry(sa).or_insert(0) += 1; - } - assert_eq!( - addrs.iter().filter(|&(_, &v)| v > 1).collect::>(), - vec![], - "There should be no duplicate localhost entries" - ); - } -} -- 2.30.2