diff --git a/library/std/src/net/ip.rs b/library/std/src/net/ip.rs index ebbb69e7065..3c795f976f8 100644 --- a/library/std/src/net/ip.rs +++ b/library/std/src/net/ip.rs @@ -1635,6 +1635,7 @@ pub const fn is_unicast_global(&self) -> bool { && !self.is_unique_local() && !self.is_unspecified() && !self.is_documentation() + && !self.is_benchmarking() } /// Returns the address's multicast scope if the address is multicast. diff --git a/library/std/src/net/ip/tests.rs b/library/std/src/net/ip/tests.rs index 0311efa8625..f5051d65fc7 100644 --- a/library/std/src/net/ip/tests.rs +++ b/library/std/src/net/ip/tests.rs @@ -329,7 +329,7 @@ macro_rules! check { check!("ff08::", global | multicast); check!("ff0e::", global | multicast); check!("2001:db8:85a3::8a2e:370:7334", doc); - check!("2001:2::ac32:23ff:21", global | benchmarking); + check!("2001:2::ac32:23ff:21", benchmarking); check!("102:304:506:708:90a:b0c:d0e:f10", global); } @@ -759,12 +759,6 @@ macro_rules! check { multicast_global | global ); - check!( - "2001:2::ac32:23ff:21", - &[0x20, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0xac, 0x32, 0x23, 0xff, 0, 0x21], - unicast_global - ); - check!( "2001:db8:85a3::8a2e:370:7334", &[0x20, 1, 0xd, 0xb8, 0x85, 0xa3, 0, 0, 0, 0, 0x8a, 0x2e, 3, 0x70, 0x73, 0x34], @@ -774,7 +768,7 @@ macro_rules! check { check!( "2001:2::ac32:23ff:21", &[0x20, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0xac, 0x32, 0x23, 0xff, 0, 0x21], - global | unicast_global | benchmarking + benchmarking ); check!(