Open bo-hub opened 1 year ago
error[E0554]:
#![feature]
may not be used on the stable release channel
Did you try running it on a nightly compiler? cargo +nighty test
?
@rubdos Thanks for this, I missed the build instruction. I used apt command in Ubuntu to install rust.
Now I removed the rust and reinstall it by
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Then I run the command rustup default nightly
to have nightly Rust installed.
But the cargo test
command get another error info.
$ cargo test
Updating crates.io index
Compiling proc-macro2 v1.0.47
Compiling unicode-ident v1.0.5
Compiling quote v1.0.21
Compiling autocfg v1.1.0
Compiling syn v1.0.103
Compiling libc v0.2.137
Compiling crossbeam-utils v0.8.12
Compiling serde_derive v1.0.147
Compiling typenum v1.15.0
Compiling getrandom v0.1.16
Compiling cfg-if v1.0.0
Compiling memchr v2.5.0
Compiling unicode-xid v0.2.4
Compiling libm v0.1.4
Compiling scopeguard v1.1.0
Compiling serde v1.0.147
Compiling byte-tools v0.3.1
Compiling serde_json v1.0.87
Compiling packed_simd_2 v0.3.8
Compiling rayon-core v1.9.3
Compiling cc v1.0.73
Compiling regex-automata v0.1.10
Compiling plotters-backend v0.3.4
error: attributes are not yet allowed on `if` expressions
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/plotters-backend-0.3.4/src/lib.rs:177:21
|
177 | #[allow(clippy::question_mark)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: Could not compile `plotters-backend`.
warning: build failed, waiting for other jobs to finish...
error: build failed
@rubdos Thanks for this, I missed the build instruction. I used apt command in Ubuntu to install rust. Now I removed the rust and reinstall it by
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Then I run the command
rustup default nightly
to have nightly Rust installed. But thecargo test
command get another error info.$ cargo test Updating crates.io index Compiling proc-macro2 v1.0.47 Compiling unicode-ident v1.0.5 Compiling quote v1.0.21 Compiling autocfg v1.1.0 Compiling syn v1.0.103 Compiling libc v0.2.137 Compiling crossbeam-utils v0.8.12 Compiling serde_derive v1.0.147 Compiling typenum v1.15.0 Compiling getrandom v0.1.16 Compiling cfg-if v1.0.0 Compiling memchr v2.5.0 Compiling unicode-xid v0.2.4 Compiling libm v0.1.4 Compiling scopeguard v1.1.0 Compiling serde v1.0.147 Compiling byte-tools v0.3.1 Compiling serde_json v1.0.87 Compiling packed_simd_2 v0.3.8 Compiling rayon-core v1.9.3 Compiling cc v1.0.73 Compiling regex-automata v0.1.10 Compiling plotters-backend v0.3.4 error: attributes are not yet allowed on `if` expressions --> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/plotters-backend-0.3.4/src/lib.rs:177:21 | 177 | #[allow(clippy::question_mark)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error error: Could not compile `plotters-backend`. warning: build failed, waiting for other jobs to finish... error: build failed
@bo-hub I have the same problem, have you solved it?
@wuliuqii Not yet
Sounds like you'll need to figure out which exact version of nightly you need. Did you try with nightly-2019-07-31
, as suggested by the rust-toolchain
file?
@rubdos
I followed the version change advice by rustup default nightly-2019-07-31
.
$ rustup default nightly-2019-07-31
info: using existing install for 'nightly-2019-07-31-x86_64-unknown-linux-gnu'
info: default toolchain set to 'nightly-2019-07-31-x86_64-unknown-linux-gnu'
nightly-2019-07-31-x86_64-unknown-linux-gnu unchanged - rustc 1.38.0-nightly (dddb7fca0 2019-07-30)
info: note that the toolchain 'nightly-2019-07-31-x86_64-unknown-linux-gnu' is currently in use (overridden by '/home/tours/code/crypto/zkproof/dalek-bulletproof/bulletproofs/rust-toolchain')
Then the cargo test get another error...
$ cargo test
Compiling plotters-backend v0.3.4
Compiling half v1.8.2
Compiling subtle v2.4.1
Compiling syn v1.0.103
Compiling crossbeam-utils v0.8.12
Compiling typenum v1.15.0
Compiling serde_derive v1.0.147
Compiling getrandom v0.1.16
Compiling libm v0.1.4
Compiling memchr v2.5.0
Compiling serde v1.0.147
Compiling clear_on_drop v0.2.5
Compiling packed_simd_2 v0.3.8
error: attributes are not yet allowed on `if` expressions
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/plotters-backend-0.3.4/src/lib.rs:177:21
|
177 | #[allow(clippy::question_mark)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
Compiling rayon-core v1.9.3
error: Could not compile `plotters-backend`.
warning: build failed, waiting for other jobs to finish...
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.4.1/src/lib.rs:575:1
|
575 | impl<T> From<CtOption<T>> for Option<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter
error: aborting due to previous error
For more information about this error, try `rustc --explain E0210`.
error: Could not compile `subtle`.
warning: build failed, waiting for other jobs to finish...
error: `core::num::<impl u16>::to_le_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/bfloat.rs:86:9
|
86 | self.0.to_le_bytes()
| ^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error: `core::num::<impl u16>::to_be_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/bfloat.rs:101:9
|
101 | self.0.to_be_bytes()
| ^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error: `core::num::<impl u16>::to_ne_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/bfloat.rs:124:9
|
124 | self.0.to_ne_bytes()
| ^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error: `core::num::<impl u16>::from_le_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/bfloat.rs:138:25
|
138 | bf16::from_bits(u16::from_le_bytes(bytes))
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error: `core::num::<impl u16>::from_be_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/bfloat.rs:152:25
|
152 | bf16::from_bits(u16::from_be_bytes(bytes))
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error: `core::num::<impl u16>::from_ne_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/bfloat.rs:174:25
|
174 | bf16::from_bits(u16::from_ne_bytes(bytes))
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error[E0723]: loops and conditional expressions are not stable in const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/bfloat.rs:281:9
|
281 | exp != 0x7F80u16 && exp != 0
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
= help: add `#![feature(const_fn)]` to the crate attributes to enable
error[E0723]: loops and conditional expressions are not stable in const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/bfloat.rs:305:14
|
305 | (0, 0) => FpCategory::Zero,
| ^
|
= note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
= help: add `#![feature(const_fn)]` to the crate attributes to enable
error[E0723]: loops and conditional expressions are not stable in const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/bfloat.rs:332:9
|
332 | / if self.is_nan() {
333 | | self
334 | | } else if self.0 & 0x8000u16 != 0 {
335 | | Self::NEG_ONE
336 | | } else {
337 | | Self::ONE
338 | | }
| |_________^
|
= note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
= help: add `#![feature(const_fn)]` to the crate attributes to enable
error: `core::num::<impl u16>::to_le_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/binary16.rs:170:9
|
170 | self.0.to_le_bytes()
| ^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error: `core::num::<impl u16>::to_be_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/binary16.rs:185:9
|
185 | self.0.to_be_bytes()
| ^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error: `core::num::<impl u16>::to_ne_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/binary16.rs:208:9
|
208 | self.0.to_ne_bytes()
| ^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error: `core::num::<impl u16>::from_le_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/binary16.rs:222:24
|
222 | f16::from_bits(u16::from_le_bytes(bytes))
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error: `core::num::<impl u16>::from_be_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/binary16.rs:236:24
|
236 | f16::from_bits(u16::from_be_bytes(bytes))
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error: `core::num::<impl u16>::from_ne_bytes` is not yet stable as a const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/binary16.rs:258:24
|
258 | f16::from_bits(u16::from_ne_bytes(bytes))
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(const_int_conversion)]` to the crate attributes to enable
error[E0723]: loops and conditional expressions are not stable in const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/binary16.rs:375:9
|
375 | exp != 0x7C00u16 && exp != 0
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
= help: add `#![feature(const_fn)]` to the crate attributes to enable
error[E0723]: loops and conditional expressions are not stable in const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/binary16.rs:399:14
|
399 | (0, 0) => FpCategory::Zero,
| ^
|
= note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
= help: add `#![feature(const_fn)]` to the crate attributes to enable
error[E0723]: loops and conditional expressions are not stable in const fn
--> /home/tours/.cargo/registry/src/github.com-1ecc6299db9ec823/half-1.8.2/src/binary16.rs:426:9
|
426 | / if self.is_nan() {
427 | | self
428 | | } else if self.0 & 0x8000u16 != 0 {
429 | | Self::NEG_ONE
430 | | } else {
431 | | Self::ONE
432 | | }
| |_________^
|
= note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
= help: add `#![feature(const_fn)]` to the crate attributes to enable
error: aborting due to 18 previous errors
For more information about this error, try `rustc --explain E0723`.
error: Could not compile `half`.
warning: build failed, waiting for other jobs to finish...
error: build failed
Any updates on this? I'm having the same issue. @bo-hub were you able to find a work around?
Error report
I git clone this repo and then run cargo test. And the error information came out.
Is there anything I should noticed?