From 839d97e27e23fd21405a999c3aae793596cd3baf Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Tue, 10 May 2022 18:06:48 +0200 Subject: [PATCH] Stabilize `Ipv6Addr::to_ipv4_mapped` CC #27709 (tracking issue for the `ip` feature which contains more functions) The function `Ipv6Addr::to_ipv4` is bad because it also returns an IPv4 address for the IPv6 loopback address `::1`. Stabilize `Ipv6Addr::to_ipv4_mapped` so we can recommend that function instead. --- library/std/src/net/ip.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/std/src/net/ip.rs b/library/std/src/net/ip.rs index f629a1a0f99..02ab0129e0f 100644 --- a/library/std/src/net/ip.rs +++ b/library/std/src/net/ip.rs @@ -1646,8 +1646,6 @@ pub const fn is_multicast(&self) -> bool { /// # Examples /// /// ``` - /// #![feature(ip)] - /// /// use std::net::{Ipv4Addr, Ipv6Addr}; /// /// assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).to_ipv4_mapped(), None); @@ -1656,7 +1654,7 @@ pub const fn is_multicast(&self) -> bool { /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1).to_ipv4_mapped(), None); /// ``` #[rustc_const_unstable(feature = "const_ipv6", issue = "76205")] - #[unstable(feature = "ip", issue = "27709")] + #[stable(feature = "ipv6_to_ipv4_mapped", since = "1.62.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] -- 2.44.0