1

当我尝试从这里构建乒乓智能合约时,使用:

erdpy build contract

我没有得到以下预期输出:

INFO:projects.core:WASM file generated: output/ping-pong.wasm

由于文件中出现以下错误sc_results.rs

Compiling elrond-codec v0.5.3
Compiling elrond-wasm v0.18.2
error[E0432]: unresolved import `core::ops::FromResidual`
--> /Users/<username>/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.18.2/src/types/io/sc_result.rs:7:30
...
error[E0437]: type Output is not a member of trait `Try`
--> /Users/<username>/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.18.2/src/types/io/sc_result.rs:62:5
...
error[E0437]: type Residual is not a member of trait `Try`
--> /Users/<username>/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.18.2/src/types/io/sc_result.rs:63:5
...
error[E0407]: method branch is not a member of trait `Try`
--> /Users/<username>/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.18.2/src/types/io/sc_result.rs:65:5
...
error[E0407]: method from_output is not a member of trait `Try`
--> /Users/<username>/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.18.2/src/types/io/sc_result.rs:71:5
...
error aborting due to 5 previous errors
...
CRITICAL:cli:Build error: error code = 101, see output.

环境:

  • elrond-wasm - v0.18.2
  • erdpy - v1.0.19

如何解决这个构建问题?

4

1 回答 1

5

问题在于,Rust 在今年早些时候进行了非向后兼容的更改。因此,与旧版本不兼容,但与新版本兼容。

使用以下方法更新 Rust:

rustup update

解决了这个问题。

现在:

rustc --version | grep -o '^[^(]*'

印刷

rustc 1.57.0-nightly
于 2021-10-13T22:34:36.340 回答