about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-08-11 16:23:45 +0900
committerGitHub <noreply@github.com>2020-08-11 16:23:45 +0900
commitf26f201d42df2a42124383eafaa23eb97f620718 (patch)
tree59a9e47f0e7fa1eddeeb1c5513b2d6998ea632c8 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parentfa853f3df0ec7b9bf86770bda85f764e9791e4ac (diff)
parent0210fd3d7303a626f6e821bde8fdfea056cc043b (diff)
downloadrust-f26f201d42df2a42124383eafaa23eb97f620718.tar.gz
rust-f26f201d42df2a42124383eafaa23eb97f620718.zip
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
* https://github.com/freebsd/freebsd/blob/1d6e4247415d264485ee94b59fdbc12e0c566fd0/contrib/ntp/lib/isc/include/isc/ipv6.h#L63
* https://github.com/zephyrproject-rtos/zephyr/blob/8b531aa996bba254c03129658490af59597acd78/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
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions