Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.2k views
in Technique[技术] by (71.8m points)

rust - error[E0554]: #![feature] may not be used on the stable release channel Couldn't install racer using cargo

I'm trying to install racer using cargo, so I executed the command cargo install racer in the terminal and it resulted in the error:

error[E0554]: #![feature] may not be used on the stable release channel
--> /home/rajkumar/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:47:34
|
47 | #![cfg_attr(feature = "nightly", feature(macro_vis_matcher))]
|                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel
--> /home/rajkumar/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:48:34
|
48 | #![cfg_attr(feature = "nightly", feature(allow_internal_unstable))]
|                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0554`.
error: failed to compile `racer v2.1.10`, intermediate artifacts can be found at `/tmp/cargo-install5YWPWW`

Caused by:
Could not compile `scoped-tls`.

To learn more, run the command again with --verbose.

Below are my Rust details:

$rustc --version
rustc 1.30.0 (da5f414c2 2018-10-24)

> rustup --version 
rustup 1.14.0 (1e51b07cc 2018-10-04)

> cargo --version 
cargo 1.30.0 (36d96825d 2018-10-24)

Below is my opensuse version details:

> cat /usr/lib/os-release 
NAME="openSUSE Tumbleweed"
# VERSION="20181029"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20181029"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20181029"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

Why am I not able to install racer using cargo? Am I missing anything?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As the error message states, you cannot compile that code with stable Rust. You need to install nightly Rust and then use it to compile the program:

rustup install nightly
cargo +nightly install racer

See also:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...