Commit 2cf7908
committed
Auto merge of rust-lang#129238 - umgefahren:stabilize-ipv6-unique-local, r=dtolnay
Stabilize `Ipv6Addr::is_unique_local` and `Ipv6Addr::is_unicast_link_local`
Make `Ipv6Addr::is_unique_local` and `Ipv6Addr::is_unicast_link_local` stable (+const).
Newly stable API:
```rust
impl Ipv6Addr {
// Newly stable under `ipv6_is_unique_local`
const fn is_unique_local(&self) -> bool;
// Newly stable under `ipv6_is_unique_local`
const fn is_unicast_link_local(&self) -> bool;
}
```
These stabilise a subset of the following tracking issue:
- rust-lang#27709
I have looked and could not find any issues with `is_unique_local` and `is_unicast_link_local`. There is a well received comment calling for stabilisation of the latter function.
Both functions are well defined and consistent with implementations in other languages:
- [Go](https://cs.opensource.google/go/go/+/refs/tags/go1.23.0:src/net/netip/netip.go;l=518)
- [Python](https://github.com/python/cpython/blob/e9d1bf353c3ccafc0d9b61b1b3688051bc976604/Lib/ipaddress.py#L2319-L2321)
- [Ruby (unique local)](https://ruby-doc.org/stdlib-2.5.1/libdoc/ipaddr/rdoc/IPAddr.html#private-3F-source)
- [Ruby (unicast link local)](https://ruby-doc.org/stdlib-2.5.1/libdoc/ipaddr/rdoc/IPAddr.html#link_local-3F-source)
cc implementor `@little-dude`
(I can't find the original PR for `is_unqiue_local`)
r? libs-api
`@rustbot` label +T-libs-api +needs-fcp1 file changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1594 | 1594 | | |
1595 | 1595 | | |
1596 | 1596 | | |
1597 | | - | |
1598 | | - | |
1599 | 1597 | | |
1600 | 1598 | | |
1601 | 1599 | | |
1602 | 1600 | | |
1603 | 1601 | | |
1604 | | - | |
1605 | 1602 | | |
1606 | 1603 | | |
| 1604 | + | |
| 1605 | + | |
1607 | 1606 | | |
1608 | 1607 | | |
1609 | 1608 | | |
| |||
1665 | 1664 | | |
1666 | 1665 | | |
1667 | 1666 | | |
1668 | | - | |
1669 | | - | |
1670 | 1667 | | |
1671 | 1668 | | |
1672 | 1669 | | |
| |||
1680 | 1677 | | |
1681 | 1678 | | |
1682 | 1679 | | |
1683 | | - | |
1684 | 1680 | | |
1685 | 1681 | | |
| 1682 | + | |
| 1683 | + | |
1686 | 1684 | | |
1687 | 1685 | | |
1688 | 1686 | | |
| |||
0 commit comments