diff --git a/library/std/src/net/tests.rs b/library/std/src/net/tests.rs index 3f5d22a910005..cb1c1ca36b124 100644 --- a/library/std/src/net/tests.rs +++ b/library/std/src/net/tests.rs @@ -41,8 +41,9 @@ pub fn compare_ignore_zoneid(a: &SocketAddr, b: &SocketAddr) -> bool { fn hostname_smoketest() { // Just a smoke test to ensure it can be called. let name = crate::net::hostname(); - if cfg!(windows) || cfg!(unix) { + if cfg!(any(all(windows, not(target_vendor = "win7")), unix)) { // At least on Windows and Unix, this should succeed. + // The `win7` Windows targets do not support it yet though. name.unwrap(); } }