我遵循了这个教程。
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版本1.1.0
谢谢
似乎你的rust nightly工具链与上面写的代码不兼容。您需要使用night-2020-10-01或使用rustup install nightly-2020-10-01
的一些不同版本的nightly工具链来降级它
每当对已知可以工作的夜间版本有疑问时,最好查看正在构建的标记/发布/分支上的基板上的shell.nix
文件。例如,在20121-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