diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2022-05-10 18:06:48 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2022-05-10 18:06:48 +0200 |
| commit | 839d97e27e23fd21405a999c3aae793596cd3baf (patch) | |
| tree | ef3550bbec5b53447e52d486e094f289b0eb8877 | |
| parent | eead58e75bb3a1d9f00b5a988704328fed6bb2c9 (diff) | |
| download | rust-839d97e27e23fd21405a999c3aae793596cd3baf.tar.gz rust-839d97e27e23fd21405a999c3aae793596cd3baf.zip | |
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.
| -rw-r--r-- | library/std/src/net/ip.rs | 4 |
1 files changed, 1 insertions, 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 @@ impl Ipv6Addr { /// # 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 @@ impl Ipv6Addr { /// 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] |
