@@ -1539,8 +1539,9 @@ impl Ipv6Addr {
15391539 /// // Addresses reserved for benchmarking (`2001:2::/48`)
15401540 /// assert_eq!(Ipv6Addr::new(0x2001, 2, 0, 0, 0, 0, 0, 1,).is_global(), false);
15411541 ///
1542- /// // Addresses reserved for documentation (`2001:db8::/32`)
1542+ /// // Addresses reserved for documentation (`2001:db8::/32` and `3fff::/20` )
15431543 /// assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 1).is_global(), false);
1544+ /// assert_eq!(Ipv6Addr::new(0x3fff, 0, 0, 0, 0, 0, 0, 0).is_global(), false);
15441545 ///
15451546 /// // Unique local addresses (`fc00::/7`)
15461547 /// assert_eq!(Ipv6Addr::new(0xfc02, 0, 0, 0, 0, 0, 0, 1).is_global(), false);
@@ -1686,11 +1687,12 @@ impl Ipv6Addr {
16861687 }
16871688
16881689 /// Returns [`true`] if this is an address reserved for documentation
1689- /// (`2001:db8::/32`).
1690+ /// (`2001:db8::/32` and `3fff::/20` ).
16901691 ///
1691- /// This property is defined in [IETF RFC 3849].
1692+ /// This property is defined by [IETF RFC 3849] and [IETF RFC 9637 ].
16921693 ///
16931694 /// [IETF RFC 3849]: https://tools.ietf.org/html/rfc3849
1695+ /// [IETF RFC 9637]: https://tools.ietf.org/html/rfc9637
16941696 ///
16951697 /// # Examples
16961698 ///
@@ -1701,12 +1703,13 @@ impl Ipv6Addr {
17011703 ///
17021704 /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_documentation(), false);
17031705 /// assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0).is_documentation(), true);
1706+ /// assert_eq!(Ipv6Addr::new(0x3fff, 0, 0, 0, 0, 0, 0, 0).is_documentation(), true);
17041707 /// ```
17051708 #[ unstable( feature = "ip" , issue = "27709" ) ]
17061709 #[ must_use]
17071710 #[ inline]
17081711 pub const fn is_documentation ( & self ) -> bool {
1709- ( self . segments ( ) [ 0 ] == 0x2001 ) && ( self . segments ( ) [ 1 ] == 0xdb8 )
1712+ matches ! ( self . segments( ) , [ 0x2001 , 0xdb8 , .. ] | [ 0x3fff , 0 ..= 0x0fff , .. ] )
17101713 }
17111714
17121715 /// Returns [`true`] if this is an address reserved for benchmarking (`2001:2::/48`).
0 commit comments