user51
user51

Reputation: 10143

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?

Upvotes: 111

Views: 79734

Answers (6)

Lukasz Dynowski
Lukasz Dynowski

Reputation: 13570

The rust error code E0554 states that #![feature] may not be used on the stable release channel. To get use of a feature you must install non-stable rust release such nightly.

rustup install nightly

Once installed refer to installation as +toolchain - cargo CLI indicates cargo [+toolchain] [OPTIONS] [COMMAND].

cargo +nightly run
cargo +nightly build

Upvotes: 2

Vagelis Prokopiou
Vagelis Prokopiou

Reputation: 2693

I had the same error coming from the thiserror crate. cargo clean fixed the problem in my case. Since it seem that this error comes up often, try to cargo clean first. Maybe nightly is not mandatory.

Upvotes: 85

Ankit Kumar
Ankit Kumar

Reputation: 496

This 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. You can use the following commands to run the code.

To install nightly version: rustup install nightly

To set nightly version as default: rustup default nightly

At anytime if you want to switch back to stable Rust: rustup default stable

The nightly version is updated very frequently, so you might want to update it every week or more often. To do so, you need to run this command: rustup update

I am closing this issue as it has been solved. If the problem persists, please comment and the issue will be reopened if appropriate

Upvotes: 26

Panagiotis Drakatos
Panagiotis Drakatos

Reputation: 3204

The command produce me a lot of errors and problems i following the below to make it work

cargo +nightly install racer

In my case, i run these 3 commands

1. rustup default nightly
2. rustup toolchain install nightly
3. rustup run nightly cargo bench 

And simply run your program with this command:

cargo +nightly bench --bin youscriptname

Upvotes: 3

Shepmaster
Shepmaster

Reputation: 430564

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:

Upvotes: 112

Fiddy Bux
Fiddy Bux

Reputation: 713

I received error 0554 when trying to compile source code using the stable channel for armv7-unknown-linux-gnueabihf.

It failed because the application uses features not available in the stable channel.

The solution was to install the nightly channel with:

rustup install nightly

And then to compile with:

cargo +nightly build --target=armv7-unknown-linux-gnueabihf

That did it for me.

Don't be tempted to follow the syntax offered when rustup installs the nightly channel, because it won't work:

cargo build --target=nightly-armv7-unknown-linux-gnueabihf

Upvotes: 7

Related Questions