错误[E0554]: #![功能] 可能无法在稳定发布频道上使用 无法使用货物安装赛车手



我正试图使用cargo安装racer,所以我在终端中执行了命令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.

以下是我的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)

以下是我的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/"

为什么我不能安装赛车使用货物?我遗漏了什么吗?

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

rustup install nightly
cargo +nightly install racer

另请参阅:

  • 如何使用夜间通道执行货物测试
  • 是否可以有多个共存的Rust安装
  • Rocket每晚都需要最低版本的Rust,但已经安装了更稳定的版本

我收到了来自thiserror机箱的相同错误。cargo clean解决了我的问题。由于这个错误似乎经常出现,请先尝试cargo clean。也许晚上不是强制性的。

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

要安装夜间版本,请执行以下操作:rustup install nightly

要将夜间版本设置为默认版本,请执行以下操作:rustup default nightly

在任何时候,如果您想切换回稳定的Rust:rustup default stable

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

我将结束这个问题,因为它已经得到解决。如果问题仍然存在,请发表意见,如果合适的话,问题将重新打开

我在尝试使用armv7-unknown-linux-gnueabihf的稳定通道编译源代码时收到错误0554。

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

解决方案是安装夜间信道与:

rustup install nightly

然后用编译

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

对我来说就是这样。

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

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

这个命令给我带来了很多错误和问题,我按照下面的步骤使它在中工作

cargo +nightly install racer

在我的情况下,我运行这3个命令

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

只需使用以下命令运行您的程序:

cargo +nightly bench --bin youscriptname

锈蚀错误代码E0554表示#![feature] may not be used on the stable release channel。要使用某个功能,您必须安装非稳定的防锈剂nightly

rustup install nightly

一旦安装,请将安装称为+toolchain-货物CLI指示cargo [+toolchain] [OPTIONS] [COMMAND]

cargo +nightly run
cargo +nightly build

最新更新