rust/library/std
Yuki Okushi f26f201d42
Rollup merge of #75085 - lzutao:ip_union, r=cuviper
Transmute big endian `s6_addr` and `[u16; 8]`

The old code already made the assumption to reinterpret
`Ipv6Addr` as `[u16; 8]`.

Glibc, Linux, FreeBSD, Win32 all makes this assumption.
The main motivation of using union it to better optimize code.
Godbolt: https://rust.godbolt.org/z/b4bGvo
Const is introducing unsafe when transmuting.

ref:
* https://docs.microsoft.com/en-us/windows/win32/api/in6addr/ns-in6addr-in6_addr
* 1d6e424741/contrib/ntp/lib/isc/include/isc/ipv6.h (L63)
* 8b531aa996/include/net/net_ip.h (L137)
* https://sourceware.org/git/?p=glibc.git;a=blob;f=inet/netinet/in.h;h=f6355c7efe5192b88337b136ef687fe9a5ed648c;hb=HEAD#l216
2020-08-11 16:23:45 +09:00
..
benches
src Rollup merge of #75085 - lzutao:ip_union, r=cuviper 2020-08-11 16:23:45 +09:00
tests
build.rs std: Switch from libbacktrace to gimli 2020-07-28 16:34:01 -07:00
Cargo.toml Update hashbrown to 0.8.1 2020-08-07 07:03:12 +01:00