rust/library
bors 3df25ae186 Auto merge of #75019 - nanpuyue:to_ipv4_mapped, r=LukasKalbertodt
Add Ipv6Addr::to_ipv4_mapped

* add Ipv6Addr::to_ipv4_mapped
* ~~deprecate Ipv4Addr::to_ipv6_compatible & Ipv6Addr::to_ipv4~~ reference: #75150

According to [IETF RFC 4291](https://tools.ietf.org/html/rfc4291#page-10), the "IPv4-Compatible IPv6 address" is deprecated.

> 2.5.5.1.  IPv4-Compatible IPv6 Address
>
>    The "IPv4-Compatible IPv6 address" was defined to assist in the IPv6
>    transition.  The format of the "IPv4-Compatible IPv6 address" is as
>    follows:
>
>    |                80 bits               | 16 |      32 bits        |
>    +--------------------------------------+--------------------------+
>    |0000..............................0000|0000|    IPv4 address     |
>    +--------------------------------------+----+---------------------+
>
>    Note: The IPv4 address used in the "IPv4-Compatible IPv6 address"
>    must be a globally-unique IPv4 unicast address.
>
>    The "IPv4-Compatible IPv6 address" is now deprecated because the
>    current IPv6 transition mechanisms no longer use these addresses.
>    New or updated implementations are not required to support this
>    address type.

And the current implementation of `Ipv4Addr::to_ipv6_compatible`is incorrect: it does not check whether the IPv4 address is a globally-unique IPv4 unicast address.

Please let me know if there are any issues with this pull request.
2020-08-12 16:30:46 +00:00
..
alloc Rollup merge of #75424 - joseluis:patch-1, r=joshtriplett 2020-08-12 12:07:21 +09:00
backtrace@4083a90168 std: Switch from libbacktrace to gimli 2020-07-28 16:34:01 -07:00
core Auto merge of #75066 - poliorcetics:document-unsafety-in-core-slice, r=LukasKalbertodt 2020-08-12 14:18:15 +00:00
panic_abort
panic_unwind Add back unwinding support for Sony PSP 2020-08-08 02:14:40 -04:00
proc_macro Stabilize Ident::new_raw 2020-08-03 17:23:31 -04:00
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #75019 - nanpuyue:to_ipv4_mapped, r=LukasKalbertodt 2020-08-12 16:30:46 +00:00
stdarch@78891cdf29 fix broken git commit in stdarch 2020-08-03 15:52:30 +08:00
term
test Rollup merge of #75270 - matthiaskrgr:clippy_aug_1, r=Dylan-DPC 2020-08-08 11:36:12 +09:00
unwind Add back unwinding support for Sony PSP 2020-08-08 02:14:40 -04:00