I have a little project that compiled and ran in Feb 2022 but now fails to build with error:
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> /Users/zicog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/socket2-0.3.12/src/sockaddr.rs:176:9
|
176 | mem::transmute::<SocketAddrV4, sockaddr_in>(v4);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: source type: `SocketAddrV4` (48 bits)
= note: target type: `sockaddr_in` (128 bits)
I'm building on a Mac M1 and Ubuntu 18.04 on ARMv8 with rustc 1.70.0 .
I gave no memory of what compiler version was used last time it did compile and run.
My experience of this kind of breakage usually leads me to all manner of experimenting, updating versions in Cargo.toml, removing Cargo.lock, etc and finally starting over with a new project and copying my code into it.
Before I start down that rabbit hole again what is a good way to track this kind of dependency/legacy/update failure?