WeBankBlockchain / liquid

Liquid 由微众银行区块链团队开发并完全开源,是一种嵌入式领域特定语言( embedded Domain Specific Language,eDSL),能够用来编写运行于区块链底层平台FISCO BCOS的智能合约。
https://liquid-doc.readthedocs.io/zh_CN/latest/
Apache License 2.0
43 stars 15 forks source link

error[E0557]: feature has been removed #6

Closed ApsarasX closed 2 years ago

ApsarasX commented 3 years ago

我的rust版本是1.53.0

按照文档编译HelloWorld时出现以下错误

[1/4] 🔍  Collecting crate metadata
[2/4] 🚚  Building cargo project
  Downloaded compiler_builtins v0.1.45 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
  Downloaded 1 crate (159.0 KB) in 5.02s
   Compiling core v0.0.0 (/Users/xxx/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core)
   Compiling compiler_builtins v0.1.45
   Compiling rustc-std-workspace-core v1.99.0 (/Users/xxx/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/var/folders/_k/g752rf1s7wx86k88qhb16rrc0000gn/T/cargo-xbuildrLidpP)
    Finished release [optimized] target(s) in 16.59s
error[E0557]: feature has been removed
  --> /Users/xxx/.cargo/git/checkouts/liquid-efa081b34c5597c9/567abc9/primitives/src/lib.rs:14:12
   |
14 | #![feature(const_fn)]
   |            ^^^^^^^^ feature has been removed
   |
   = note: split into finer-grained feature gates

error[E0557]: feature has been removed
  --> /Users/xxx/.cargo/git/checkouts/liquid-efa081b34c5597c9/567abc9/primitives/src/lib.rs:14:12
   |
14 | #![feature(const_fn)]
   |            ^^^^^^^^ feature has been removed
   |
   = note: split into finer-grained feature gates

error: aborting due to previous error

For more information about this error, try `rustc --explain E0557`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0557`.
error: could not compile `liquid_primitives`

To learn more, run the command again with --verbose.
error: build failed
ERROR: xbuild failed with status exit status: 101
vita-dounai commented 3 years ago

出现这个问题的原因是,在新版本的rustc中const_fn这个特性已经stable了,所以用新版编译器编译的话就会出现feature不存在的错误。这是我们的失误,我们之前没有预料到这个特性会这么快就稳定。

解决办法: 将通过rustup default等手段将编译器版本回退到2021-03-25之前的版本。

在下一个版本中我们将会为项目添加rust-toolchain文件以对编译环境进行限制,以保证不会再出现类似的错误。

bxq2011hust commented 3 years ago
rustup toolchain install nightly-2021-03-25
rustup default nightly-2021-03-25
vita-dounai commented 2 years ago

v1.0.0-rc2 版本已通过rust-toolchain文件解决了该问题

vita-dounai commented 2 years ago

v1.0.0-rc2 版本已通过rust-toolchain文件解决了该问题

@bxq2011hust 可以close了😏