如何解决构建错误时出错[E0282]:需要类型注释 注意:这应该很快在基板 v2.0.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 货物构建 --release
和
WASM_BUILD_TOOLCHAIN=nightly-2020-10-05 货物构建 --release
https://stackoverflow.com/a/63993797/1566713
解决方法
注意:这应该很快在基板 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)
,
这里是问题 https://github.com/paritytech/substrate/issues/7287
只用这一行解决
rustup default nightly-2020-10-06 && rustup target add wasm32-unknown-unknown
,
此问题已在 v2.0.1 中修复,请尝试使用以下命令删除项目并再次克隆。
git clone -b v2.0.1 --depth 1 https://github.com/substrate-developer-hub/substrate-node-template
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。