错误[E0554]:稳定版本频道上不能使用#![功能]无法使用货物安装赛车

Raj*_*jan 22 rust rust-cargo

我正在尝试使用货物安装赛车,所以我cargo install racer在终端执行了命令,结果导致错误:

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.
Run Code Online (Sandbox Code Playgroud)

以下是我的Rust详细信息:

$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)
Run Code Online (Sandbox Code Playgroud)

以下是我的opensuse版本详细信息:

> 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/"
Run Code Online (Sandbox Code Playgroud)

为什么我无法使用货物安装赛车?我错过了什么吗?

Vag*_*iou 82

我在板条箱中遇到了同样的错误thiserrorcargo clean解决了我的问题。由于此错误似乎经常出现,因此cargo clean请先尝试。也许每晚不是强制性的。

  • “无论如何”板条箱也有同样的问题。这个技巧解决了它。 (4认同)

She*_*ter 26

正如错误消息所述,您无法使用稳定的Rust编译该代码.你需要每晚安装Rust然后用它来编译程序:

rustup install nightly
cargo +nightly install racer
Run Code Online (Sandbox Code Playgroud)


小智 22

此错误消息指出,您无法使用稳定的 Rust 编译该代码。您需要安装 nightly Rust,然后使用它来编译程序。您可以使用以下命令来运行代码。

要安装夜间版本: rustup install nightly

要将夜间版本设置为默认版本: rustup default nightly

如果您想随时切换回稳定的 Rust: rustup default stable

每晚版本的更新非常频繁,因此您可能需要每周或更频繁地更新它。为此,您需要运行以下命令: rustup update

我将关闭这个问题,因为它已经解决了。如果问题仍然存在,请发表评论,如果合适,问题将重新开放


Fid*_*Bux 7

当我尝试使用armv7-unknown-linux-gnueabihf.

它失败了,因为应用程序使用了稳定通道中不可用的功能。

解决方案是安装夜间频道:

rustup install nightly
Run Code Online (Sandbox Code Playgroud)

然后编译:

cargo +nightly build --target=armv7-unknown-linux-gnueabihf
Run Code Online (Sandbox Code Playgroud)

那对我来说是这样的。

不要试图遵循 rustup 安装 nightly 通道时提供的语法,因为它不起作用:

cargo build --target=nightly-armv7-unknown-linux-gnueabihf
Run Code Online (Sandbox Code Playgroud)