1
error[E0282]: type annotations needed
    --> /home/amiya/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9
     |
541  |                   let accuracy = P::ACCURACY.saturated_into();
     |                       ^^^^^^^^ consider giving `accuracy` a type
...
1595 | / implement_fixed!(
1596 | |     FixedI64,
1597 | |     test_fixed_i64,
1598 | |     i64,
...    |
1601 | |     "_Fixed Point 64 bits signed, range = [-9223372036.854775808, 9223372036.854775807]_",
1602 | | );
     | |__- in this macro invocation
     |
     = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0282]: type annotations needed
    --> /home/amiya/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9
     |
541  |                   let accuracy = P::ACCURACY.saturated_into();
     |                       ^^^^^^^^ consider giving `accuracy` a type
...
1604 | / implement_fixed!(
1605 | |     FixedI128,
1606 | |     test_fixed_i128,
1607 | |     i128,
...    |
1611 | |         [-170141183460469231731.687303715884105728, 170141183460469231731.687303715884105727]_",
1612 | | );
     | |__- in this macro invocation
     |
     = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0282]: type annotations needed
    --> /home/amiya/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9
     |
541  |                   let accuracy = P::ACCURACY.saturated_into();
     |                       ^^^^^^^^ consider giving `accuracy` a type

我正在使用 Ubuntu 20.04,它对
WASM_BUILD_TOOLCHAIN=nightly-2020-08-23 cargo build --release

WASM_BUILD_TOOLCHAIN=nightly-2020-10-05 cargo build --release给出相同的错误

https://github.com/substrate-developer-hub/substrate-node-template/blob/4d97032c11b8c65936e53a61607d4522d45a29ea/Makefile

https://stackoverflow.com/a/63993797/1566713

4

3 回答 3

2

注意:这应该很快在基板 v2.0.1 中修复

现在您可能需要降级您的工具链:https ://substrate.dev/docs/en/knowledgebase/getting-started/#downgrading-rust-nightly

对我来说,已知的工作日期适用2020-10-5于所有工具链,默认情况下从该日期开始每晚使用。

我也在 Ubuntu 20.04LTS 上,并使用:

$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  ....

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-2020-10-05-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-2020-10-05-x86_64-unknown-linux-gnu (default)
rustc 1.49.0-nightly (beb5ae474 2020-10-04)
于 2021-01-06T17:46:18.387 回答
1

这已在 v2.0.1 中修复,尝试删除项目并使用以下命令再次克隆。

git clone -b v2.0.1 --depth 1 https://github.com/substrate-developer-hub/substrate-node-template
于 2021-01-17T02:54:41.623 回答
1

这是问题https://github.com/paritytech/substrate/issues/7287

仅用这一行即可解决

rustup default nightly-2020-10-06 && rustup target add wasm32-unknown-unknown
于 2021-01-09T03:39:12.860 回答