From 3ace8f4a631c11e72d2cfbb62ad3a931d6c6cf7f Mon Sep 17 00:00:00 2001 From: Paul Mabileau Date: Mon, 29 Jun 2026 13:42:13 +0200 Subject: [PATCH] Test(lib/net): Fix `hostname_smoketest` for Win7 This test currently fails under both x86 and x86_64 Win7 on: ``` thread 'net::tests::hostname_smoketest' (2304) panicked at library/std/src/net/tests.rs:46:14: called `Result::unwrap()` on an `Err` value: Error { kind: Unsupported, message: "operation not supported on this platform" } ``` This is simply because the feature was made to be effectively disabled under these targets in PR 150905. The test is therefore fixed in order to reflect that appropriately. Signed-off-by: Paul Mabileau --- library/std/src/net/tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); } }