multiversx / mx-ping-pong-sc

GNU General Public License v3.0
14 stars 13 forks source link

rustc --explain E0277 #5

Open lgriger-git opened 2 years ago

lgriger-git commented 2 years ago

Hi please help :). this output I still got when I tried build contract

INFO:projects.core:build_project.directory: /Users/lgriger/elrondapp/ping-pong/contract/ping-pong INFO:projects.core:build_project.debug: False INFO:myprocess:run_process: ['rustc', '--version'], in folder: None INFO:myprocess:Successful run. Output: rustc 1.60.0-nightly (e0a55f449 2022-01-28)

Updating crates.io index Compiling version_check v0.9.4 Compiling proc-macro2 v1.0.36 Compiling unicode-xid v0.2.2 Compiling libc v0.2.116 Compiling syn v1.0.86 Compiling autocfg v1.0.1 Compiling typenum v1.15.0 Compiling cfg-if v1.0.0 Compiling hex v0.4.3 Compiling serde_derive v1.0.136 Compiling wee_alloc v0.4.5 Compiling memory_units v0.4.0 Compiling cfg-if v0.1.10 Compiling serde v1.0.136 Compiling once_cell v1.9.0 Compiling block-padding v0.2.1 Compiling endian-type v0.1.2 Compiling nibble_vec v0.0.4 Compiling opaque-debug v0.3.0 Compiling semver v1.0.4 Compiling serde_json v1.0.78 Compiling arrayvec v0.7.2 Compiling bitflags v1.3.2 Compiling keccak v0.1.0 Compiling hex-literal v0.3.4 Compiling ryu v1.0.9 Compiling itoa v1.0.1 Compiling generic-array v0.14.5 Compiling ahash v0.7.6 Compiling num-traits v0.2.14 Compiling num-integer v0.1.44 Compiling num-bigint v0.4.3 Compiling radix_trie v0.1.6 Compiling getrandom v0.2.4 Compiling cpufeatures v0.2.1 Compiling quote v1.0.15 Compiling rustc_version v0.4.0 Compiling digest v0.9.0 Compiling block-buffer v0.9.0 Compiling sha3 v0.9.1 Compiling sha2 v0.9.9 Compiling hashbrown v0.11.2 Compiling elrond-codec-derive v0.8.4 Compiling elrond-wasm-derive v0.22.11 Compiling elrond-codec v0.8.4 Compiling elrond-wasm v0.22.11 error[E0277]: the trait bound elrond_codec::DecodeError: From<&[u8]> is not satisfied --> /Users/lgriger/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.22.11/src/types/general/h256.rs:219:21 219 exit(c, DecodeError::from(ERR_BAD_H256_LENGTH)); ^^^^^^^^^^^^^^^^^ the trait From<&[u8]> is not implemented for elrond_codec::DecodeError

= help: the following implementations were found: <elrond_codec::DecodeError as From<&'static str>> <elrond_codec::DecodeError as From<CapacityError>>

error[E0277]: the trait bound elrond_codec::DecodeError: From<&[u8]> is not satisfied --> /Users/lgriger/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.22.11/src/types/general/h256.rs:231:27 231 Err(_) => Err(DecodeError::from(ERR_BAD_H256_LENGTH)), ^^^^^^^^^^^^^^^^^ the trait From<&[u8]> is not implemented for elrond_codec::DecodeError

= help: the following implementations were found: <elrond_codec::DecodeError as From<&'static str>> <elrond_codec::DecodeError as From<CapacityError>>

error[E0277]: the trait bound elrond_codec::DecodeError: From<&[u8]> is not satisfied --> /Users/lgriger/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.22.11/src/types/managed/managed_byte_array.rs:114:24 114 return Err(DecodeError::from(DECODE_ERROR_BAD_LENGTH)); ^^^^^^^^^^^^^^^^^ the trait From<&[u8]> is not implemented for elrond_codec::DecodeError

= help: the following implementations were found: <elrond_codec::DecodeError as From<&'static str>> <elrond_codec::DecodeError as From<CapacityError>>

For more information about this error, try rustc --explain E0277. error: could not compile elrond-wasm due to 3 previous errors warning: build failed, waiting for other jobs to finish... error: build failed CRITICAL:cli:Build error: error code = 101, see output.

MacOS Monterey rustup 1.24.3 (ce5817a94 2021-05-31) rustc 1.58.1 (db9d1b20b 2022-01-20) cargo 1.58.0 (f01b232bc 2022-01-19)

bouchja1 commented 2 years ago

I am dealing with the same problem.

macOS Big Sur (version 11.5.2) Python 3.8.9 pip 22.0 erdpy 1.0.24

@Kaco92 I guess that the version of rustc you and I have is rustc 1.60.0-nightly as it is mentioned in your output above:

INFO:myprocess:Successful run. Output: rustc 1.60.0-nightly (e0a55f449 2022-01-28)

lgriger-git commented 2 years ago

I got some Hint from elrond dev gus ( Try reinstall rust by comand 'erdpy deps install rust --overwrite ' )

bluedragon1120 commented 1 year ago

I solved this issue like this. I used "mxpy contract build --no-wasm-opt" instead of "mxpy contract build". Plz try to again with this.