Skip to content

Commit 839d97e

Browse files
committed
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.
1 parent eead58e commit 839d97e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

library/std/src/net/ip.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,8 +1646,6 @@ impl Ipv6Addr {
16461646
/// # Examples
16471647
///
16481648
/// ```
1649-
/// #![feature(ip)]
1650-
///
16511649
/// use std::net::{Ipv4Addr, Ipv6Addr};
16521650
///
16531651
/// assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).to_ipv4_mapped(), None);
@@ -1656,7 +1654,7 @@ impl Ipv6Addr {
16561654
/// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1).to_ipv4_mapped(), None);
16571655
/// ```
16581656
#[rustc_const_unstable(feature = "const_ipv6", issue = "76205")]
1659-
#[unstable(feature = "ip", issue = "27709")]
1657+
#[stable(feature = "ipv6_to_ipv4_mapped", since = "1.62.0")]
16601658
#[must_use = "this returns the result of the operation, \
16611659
without modifying the original"]
16621660
#[inline]

0 commit comments

Comments
 (0)