我正在尝试使用clap板条箱进行一些参数解析。但是,当我将其添加到我的时Cargo.toml,我会收到以下错误cargo build:
$ cargo build
Compiling rustix v0.36.5
error[E0554]: `#![feature]` may not be used on the stable release channel
--> /home/wheeler/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.36.5/src/lib.rs:99:26
|
99 | #![cfg_attr(rustc_attrs, feature(rustc_attrs))]
| ^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> /home/wheeler/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.36.5/src/lib.rs:116:5
|
116 | feature(core_intrinsics)
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> /home/wheeler/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.36.5/src/lib.rs:116:13
|
116 | feature(core_intrinsics)
| ^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0554`.
error: could not compile `rustix` due to 3 previous errors
Run Code Online (Sandbox Code Playgroud)
文档中没有任何内容clap表明它需要使用夜间构建。我不明白为什么会发生这种情况,因此我创建了一个虚拟机来尝试复制该问题(使用 Vagrant)。这是 Vagrant 文件:
$ cargo build
Compiling rustix v0.36.5
error[E0554]: `#![feature]` may not be used on the stable release channel
--> /home/wheeler/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.36.5/src/lib.rs:99:26
|
99 | #![cfg_attr(rustc_attrs, feature(rustc_attrs))]
| ^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> /home/wheeler/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.36.5/src/lib.rs:116:5
|
116 | feature(core_intrinsics)
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> /home/wheeler/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.36.5/src/lib.rs:116:13
|
116 | feature(core_intrinsics)
| ^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0554`.
error: could not compile `rustix` due to 3 previous errors
Run Code Online (Sandbox Code Playgroud)
但是当我这样做时,虚拟机会更新、安装 Rust,并编译我的小示例程序(它与我在主机系统上的vagrant up完全相同)。main.rsCargo.toml
为什么clap我的主机上需要夜间版本,但测试虚拟机上不需要?
whe*_*ler 14
target导致此问题的目录中缓存了某些内容。我删除了该target目录并重新运行cargo build,问题就消失了。
| 归档时间: |
|
| 查看次数: |
3473 次 |
| 最近记录: |