How to execute cargo test using the nightly channel?

后端 未结 2 389
终归单人心
终归单人心 2020-12-16 10:51

I\'m trying to run my tests with nightly Rust using Windows Powershell. I run cargo test in the directory, and I get



        
2条回答
  •  情深已故
    2020-12-16 10:59

    The + functionality comes from rustup, the Rust toolchain manager. It works for both cargo + as well as rustc +.

    In addition, you can use

    • rustup run
    • Since your project requires nightly features, you can change into the directory and run rustup override set to always use the nightly toolchain in that directory.
    • Create a file called rust-toolchain in your directory containing the name of the toolchain required (e.g. nightly). This has the safe effect as an override, but can be committed to source control.

    See also:

    • Is it possible to have multiple coexisting Rust installations?

提交回复
热议问题