【问题标题】:error[E0554]: #![feature] may not be used on the stable release channel Couldn't install racer using cargoerror[E0554]: #![feature] may not be used on the stable release channel 无法使用 cargo 安装racer
【发布时间】:2019-04-07 18:27:45
【问题描述】:

我正在尝试使用 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/"

为什么我无法使用 cargo 安装 Racer?我错过了什么吗?

【问题讨论】:

标签: rust rust-cargo


【解决方案1】:

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

rustup install nightly
cargo +nightly install racer

另见:

【讨论】:

    【解决方案2】:

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

    由于应用程序使用了稳定频道中不可用的功能而失败。

    解决方案是安装 nightly 频道:

    rustup install nightly
    

    然后编译:

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

    这对我有用。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-30
      • 2014-10-02
      • 1970-01-01
      • 1970-01-01
      • 2013-01-14
      • 1970-01-01
      • 1970-01-01
      • 2014-01-08
      相关资源
      最近更新 更多