Substrate 节点模板构建错误 E0277
Substrate node template build Error E0277
我遵循了本教程。
https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/setup
当我 运行 cargo build --release
然后得到错误:
error[E0277]: `[parity_wasm::elements::Instruction; 15]` is not an iterator
--> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/pwasm-utils-0.18.2/src/stack_height/mod.rs:300:23
|
300 | new_instrs.extend(new_seq);
| ^^^^^^^
| |
| expected an implementor of trait `IntoIterator`
| help: consider borrowing here: `&new_seq`
|
= note: the trait bound `[parity_wasm::elements::Instruction; 15]: IntoIterator` is not satisfied
= note: required because of the requirements on the impl of `IntoIterator` for `[parity_wasm::elements::Instruction; 15]`
Compiling unsigned-varint v0.7.0
我用的是Ubuntu & cargo version 1.51.0
谢谢
您的 Rust Nightly 工具链似乎与上面编写的代码不兼容。您需要使用 nightly-2020-10-01 或使用 rustup install nightly-2020-10-01
的某些不同版本的 nightly 工具链将其降级
每当对已知的夜间版本有疑问时,最好查看您正在构建的 tag/release/branch 中的 shell.nix
file on substrate。例如,截至 2021 年 10 月 11 日 master
:
rust-nightly = with nixpkgs; ((rustChannelOf { date = "2021-09-10"; channel = "nightly"; }).rust.override {...}
您可以使用以下任何版本降级您的工具链(也适用于 wasm 目标,底层构建需要):
rustup uninstall nightly
rustup install nightly-<YYYY-MM-DD>
rustup target add wasm32-unknown-unknown --toolchain nightly-<YYYY-MM-DD>
然后构建:
WASM_BUILD_TOOLCHAIN=nightly-<yyyy-MM-dd> cargo build --release
我遵循了本教程。
https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/setup
当我 运行 cargo build --release
然后得到错误:
error[E0277]: `[parity_wasm::elements::Instruction; 15]` is not an iterator
--> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/pwasm-utils-0.18.2/src/stack_height/mod.rs:300:23
|
300 | new_instrs.extend(new_seq);
| ^^^^^^^
| |
| expected an implementor of trait `IntoIterator`
| help: consider borrowing here: `&new_seq`
|
= note: the trait bound `[parity_wasm::elements::Instruction; 15]: IntoIterator` is not satisfied
= note: required because of the requirements on the impl of `IntoIterator` for `[parity_wasm::elements::Instruction; 15]`
Compiling unsigned-varint v0.7.0
我用的是Ubuntu & cargo version 1.51.0
谢谢
您的 Rust Nightly 工具链似乎与上面编写的代码不兼容。您需要使用 nightly-2020-10-01 或使用 rustup install nightly-2020-10-01
每当对已知的夜间版本有疑问时,最好查看您正在构建的 tag/release/branch 中的 shell.nix
file on substrate。例如,截至 2021 年 10 月 11 日 master
:
rust-nightly = with nixpkgs; ((rustChannelOf { date = "2021-09-10"; channel = "nightly"; }).rust.override {...}
您可以使用以下任何版本降级您的工具链(也适用于 wasm 目标,底层构建需要):
rustup uninstall nightly
rustup install nightly-<YYYY-MM-DD>
rustup target add wasm32-unknown-unknown --toolchain nightly-<YYYY-MM-DD>
然后构建:
WASM_BUILD_TOOLCHAIN=nightly-<yyyy-MM-dd> cargo build --release