openbook-dex / program

Openbook dex solana program
Apache License 2.0
171 stars 93 forks source link

Cannot transmute between types of different sizes, or dependently-sized types #42

Closed mabdelmenam closed 3 months ago

mabdelmenam commented 3 months ago

Getting error when trying to run " cargo test "

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types --> /home/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/socket2-0.3.15/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)

Compiling sct v0.6.0 Compiling dirs-sys-next v0.1.1 For more information about this error, try rustc --explain E0512. Compiling yaml-rust v0.4.3 error: could not compile socket2 (lib) due to 1 previous error

riordanp commented 3 months ago

which rust toolchain are you using? if you're on apple silicon please make sure you're using a *-x86_64-apple-darwin toolchain

mabdelmenam commented 3 months ago

I fixed it, i needed to downgrade and use rustc version 1.59.0.