我正在尝试使用Windows Powershell每晚使用Rust运行我的测试.我cargo test在目录中运行,我得到了
Compiling rustcraft v0.1.0 (file:///C:/Users/Phoenix/Desktop/Rust/rustcraft)
error[E0554]: #![feature] may not be used on the stable release channel
--> C:\Users\Phoenix\Desktop\Rust\rustcraft\src\main.rs:1:1
|
1 | #![feature(integer_atomics)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: #![feature] may not be used on the stable release channel
--> C:\Users\Phoenix\Desktop\Rust\rustcraft\src\main.rs:2:1
|
2 | #![feature(collections)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
Run Code Online (Sandbox Code Playgroud)
显然,我必须告诉Cargo在夜间频道编译它,但是怎么样?我找不到在帮助部分或我找到的任何网站中指定频道的任何参考.
小智 27
命令行解决方案可以帮助您配置IDE:
cargo +nightly test
Run Code Online (Sandbox Code Playgroud)
当然,您已经安装了夜间频道.如果没有,也许安装它rustup install nightly(不需要切换到它,但检查你仍然稳定:) rustup show.
She*_*ter 19
该+<toolchain>功能来自rustup,铁锈工具链经理.它既适用于两者cargo +<toolchain>,也适用于rustc +<toolchain>.
另外,你可以使用
rustup run <toolchain> <any arbitrary command goes here>rustup override set <toolchain>以始终使用该目录中的夜间工具链.rust-toolchain.这具有作为覆盖的安全效果,但可以提交到源代码控制.也可以看看: