rust/library
Matthias Krüger 17113f7db6
Rollup merge of #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:

- https://github.com/rust-lang/rust/issues/27709
- https://github.com/rust-lang/rust/issues/76205

Stabilization of all methods under the `ip` gate was attempted once at https://github.com/rust-lang/rust/pull/66584 then again at https://github.com/rust-lang/rust/pull/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 https://github.com/rust-lang/rust/pull/87708

cc implementor ``@the8472``

r? libs-api
``@rustbot`` label +T-libs-api +needs-fcp
2023-10-16 06:26:20 +02:00
..
alloc Auto merge of #116407 - Mark-Simulacrum:bootstrap-bump, r=onur-ozkan 2023-10-14 05:44:48 +00:00
backtrace@99faef833f Bump backtrace to 0.3.69 2023-08-22 15:01:14 -07:00
core Rollup merge of #115955 - tgross35:ip-to-canonical, r=dtolnay 2023-10-16 06:26:20 +02:00
panic_abort Rebase to master 2023-09-22 17:23:33 +05:30
panic_unwind Rename BoxMeUp to PanicPayload. 2023-09-20 19:24:52 +02:00
portable-simd remove repetitive words 2023-07-31 16:13:02 +08:00
proc_macro rustdoc: remove rust logo from non-Rust crates 2023-10-08 20:17:53 -07:00
profiler_builtins Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
rtstartup
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #114589 - ijackson:exit-code-default, r=dtolnay 2023-10-16 02:06:01 +00:00
stdarch@333e9e9977 Bump stdarch submodule 2023-10-02 23:43:35 +02:00
sysroot Expose compiler-builtins-weak-intrinsics feature for -Zbuild-std 2023-06-23 11:15:34 +01:00
test rustdoc: remove rust logo from non-Rust crates 2023-10-08 20:17:53 -07:00
unwind Support AIX in Rust standard library 2023-10-09 14:02:57 +08:00