nix icon indicating copy to clipboard operation
nix copied to clipboard

MSRV 1.56.0 TODO

Open asomers opened this issue 3 years ago • 3 comments
trafficstars

After raising the MSRV to 1.56.0:

  • Simplify ipv4addr_to_libc and ipv4addr_to_libc by changing their bodies to a simple mem::transmute, since Ipv4Addr and Ipv6Addr are simple newtypes around the libc types.

asomers avatar Mar 23 '22 03:03 asomers

Is std::mem::transmute sound for std::net::Ipv4Addr? It isn't marked repr(transparent).

rtzoeller avatar Mar 23 '22 03:03 rtzoeller

If we have a static_assertion that guarantees that Ipv4Addr and libc::sockaddr_in are the same size, then it's safe, right? That was my plan.

asomers avatar Mar 23 '22 03:03 asomers

I believe that should be fine.

rtzoeller avatar Mar 23 '22 03:03 rtzoeller