我试图使用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.

以下是我的详细信息:

$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?我错过什么了吗?

推荐答案

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

rustup install nightly
cargo +nightly install racer

另见:

Rust相关问答推荐

为什么我们不能通过指针算法将Rust原始指针指向任意地址?'

Rust kill std::processs::child

如何创建引用构造函数拥有的变量的对象?

在自身功能上实现类似移动的行为,以允许通过大小的所有者进行呼叫(&;mut;self)?

在Rust中宏的表达式中提取对象

有没有办法在Rust中配置常量变量的值?

一种随机局部搜索算法的基准(分数)

如何执行数组文字的编译时串联?

使用启用优化的 alloc 会导致非法指令崩溃

在1.5n次比较中找到整数向量中的最大和次大整数

我可以在 Rust 中 serde struct camel_case 和 deserde PascalCase

Rust Serde 为 Option:: 创建反序列化器

为什么 File::read_to_end 缓冲区容量越大越慢?

强制特征仅在 Rust 中的给定类型大小上实现

n 个范围的笛卡尔积

如何异步记忆选项中的 struct 字段

如何将切片推入数组?

具有生命周期和以后引用的可变方法

在传输不可复制的值时实现就地枚举修改

为什么这里需要类型注解?