Commit 0e5cf4f
authored
Rollup merge of rust-lang#115955 - tgross35:ip-to-canonical, r=dtolnay
Stabilize `{IpAddr, Ipv6Addr}::to_canonical`
Make `IpAddr::to_canonical` and `IpV6Addr::to_canonical` stable (+const), as well as const stabilize `Ipv6Addr::to_ipv4_mapped`.
Newly stable API:
```rust
impl IpAddr {
// Newly stable under `ip_to_canonical`
const fn to_canonical(&self) -> IpAddr;
}
impl Ipv6Addr {
// Newly stable under `ip_to_canonical`
const fn to_canonical(&self) -> IpAddr;
// Already stable, this makes it const stable under
// `const_ipv6_to_ipv4_mapped`
const fn to_ipv4_mapped(&self) -> Option<Ipv4Addr>
}
```
These stabilize a subset of the following tracking issues:
- rust-lang#27709
- rust-lang#76205
Stabilization of all methods under the `ip` gate was attempted once at rust-lang#66584 then again at rust-lang#76098. These were not successful because there are still unknowns about `is_documentation` `is_benchmarking` and similar; `to_canonical` is much more straightforward.
I have looked and could not find any known issues with `to_canonical`. These were added in 2021 in rust-lang#87708
cc implementor `@the8472`
r? libs-api
`@rustbot` label +T-libs-api +needs-fcp1 file changed
+13
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
414 | 413 | | |
415 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
416 | 419 | | |
417 | 420 | | |
418 | 421 | | |
419 | 422 | | |
420 | 423 | | |
421 | 424 | | |
422 | 425 | | |
423 | | - | |
424 | | - | |
| 426 | + | |
| 427 | + | |
425 | 428 | | |
426 | 429 | | |
427 | | - | |
| 430 | + | |
428 | 431 | | |
429 | 432 | | |
430 | 433 | | |
| |||
1748 | 1751 | | |
1749 | 1752 | | |
1750 | 1753 | | |
1751 | | - | |
1752 | | - | |
| 1754 | + | |
1753 | 1755 | | |
1754 | 1756 | | |
1755 | | - | |
| 1757 | + | |
| 1758 | + | |
1756 | 1759 | | |
1757 | 1760 | | |
1758 | 1761 | | |
| |||
1817 | 1820 | | |
1818 | 1821 | | |
1819 | 1822 | | |
1820 | | - | |
1821 | | - | |
| 1823 | + | |
1822 | 1824 | | |
1823 | 1825 | | |
1824 | | - | |
| 1826 | + | |
| 1827 | + | |
1825 | 1828 | | |
1826 | 1829 | | |
1827 | 1830 | | |
| |||
0 commit comments