Skip to content

Commit 67fb0bc

Browse files
author
The Miri Conjob Bot
committed
Merge from rustc
2 parents afa6a00 + 1a9025e commit 67fb0bc

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

core/src/net/ip_addr.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,11 @@ impl Ipv4Addr {
771771
|| self.is_loopback()
772772
|| self.is_link_local()
773773
// addresses reserved for future protocols (`192.0.0.0/24`)
774-
||(self.octets()[0] == 192 && self.octets()[1] == 0 && self.octets()[2] == 0)
774+
// .9 and .10 are documented as globally reachable so they're excluded
775+
|| (
776+
self.octets()[0] == 192 && self.octets()[1] == 0 && self.octets()[2] == 0
777+
&& self.octets()[3] != 9 && self.octets()[3] != 10
778+
)
775779
|| self.is_documentation()
776780
|| self.is_benchmarking()
777781
|| self.is_reserved()
@@ -1515,8 +1519,12 @@ impl Ipv6Addr {
15151519
// AS112-v6 (`2001:4:112::/48`)
15161520
|| matches!(self.segments(), [0x2001, 4, 0x112, _, _, _, _, _])
15171521
// ORCHIDv2 (`2001:20::/28`)
1518-
|| matches!(self.segments(), [0x2001, b, _, _, _, _, _, _] if b >= 0x20 && b <= 0x2F)
1522+
// Drone Remote ID Protocol Entity Tags (DETs) Prefix (`2001:30::/28`)`
1523+
|| matches!(self.segments(), [0x2001, b, _, _, _, _, _, _] if b >= 0x20 && b <= 0x3F)
15191524
))
1525+
// 6to4 (`2002::/16`) – it's not explicitly documented as globally reachable,
1526+
// IANA says N/A.
1527+
|| matches!(self.segments(), [0x2002, _, _, _, _, _, _, _])
15201528
|| self.is_documentation()
15211529
|| self.is_unique_local()
15221530
|| self.is_unicast_link_local())

core/tests/net/ip_addr.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,10 @@ fn ipv4_properties() {
461461
check!("198.18.54.2", benchmarking);
462462
check!("198.19.255.255", benchmarking);
463463
check!("192.0.0.0");
464+
check!("192.0.0.8");
465+
check!("192.0.0.9", global);
466+
check!("192.0.0.10", global);
467+
check!("192.0.0.11");
464468
check!("192.0.0.255");
465469
check!("192.0.0.100");
466470
check!("240.0.0.0", reserved);
@@ -480,6 +484,10 @@ fn ipv6_properties() {
480484
}
481485

482486
macro_rules! check {
487+
($s:expr, &[$($octet:expr),*]) => {
488+
check!($s, &[$($octet),*], 0);
489+
};
490+
483491
($s:expr, &[$($octet:expr),*], $mask:expr) => {
484492
assert_eq!($s, ip!($s).to_string());
485493
let octets = &[$($octet),*];
@@ -656,15 +664,17 @@ fn ipv6_properties() {
656664
&[0x20, 1, 0, 0x20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
657665
global | unicast_global
658666
);
659-
660-
check!("2001:30::", &[0x20, 1, 0, 0x30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], unicast_global);
667+
check!("2001:30::", &[0x20, 1, 0, 0x30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], global | unicast_global);
668+
check!("2001:40::", &[0x20, 1, 0, 0x40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], unicast_global);
661669

662670
check!(
663671
"2001:200::",
664672
&[0x20, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
665673
global | unicast_global
666674
);
667675

676+
check!("2002::", &[0x20, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], unicast_global);
677+
668678
check!("fc00::", &[0xfc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], unique_local);
669679

670680
check!(

std/src/sync/mutex.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,6 @@ impl<T: ?Sized> Mutex<T> {
383383
/// # Examples
384384
///
385385
/// ```
386-
/// #![feature(mutex_unpoison)]
387-
///
388386
/// use std::sync::{Arc, Mutex};
389387
/// use std::thread;
390388
///
@@ -406,7 +404,7 @@ impl<T: ?Sized> Mutex<T> {
406404
/// assert_eq!(*x, 1);
407405
/// ```
408406
#[inline]
409-
#[unstable(feature = "mutex_unpoison", issue = "96469")]
407+
#[stable(feature = "mutex_unpoison", since = "CURRENT_RUSTC_VERSION")]
410408
pub fn clear_poison(&self) {
411409
self.poison.clear();
412410
}

std/src/sync/rwlock.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,6 @@ impl<T: ?Sized> RwLock<T> {
387387
/// # Examples
388388
///
389389
/// ```
390-
/// #![feature(mutex_unpoison)]
391-
///
392390
/// use std::sync::{Arc, RwLock};
393391
/// use std::thread;
394392
///
@@ -410,7 +408,7 @@ impl<T: ?Sized> RwLock<T> {
410408
/// assert_eq!(*guard, 1);
411409
/// ```
412410
#[inline]
413-
#[unstable(feature = "mutex_unpoison", issue = "96469")]
411+
#[stable(feature = "mutex_unpoison", since = "CURRENT_RUSTC_VERSION")]
414412
pub fn clear_poison(&self) {
415413
self.poison.clear();
416414
}

0 commit comments

Comments
 (0)