Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell cargo to use nightly? [duplicate]

I know I can set rust nightly on a project by running rustup override set nightly. But I was wondering if I could state it on the Cargo.toml, so if I build in another machine it'll just run with nightly from the start. So far I haven't been able to find a way to do it.

like image 795
Tomás Vallotton Avatar asked Mar 17 '21 21:03

Tomás Vallotton


People also ask

Where does cargo build output go?

Output Options Defaults to target in the root of the workspace. Copy final artifacts to this directory. This option is unstable and available only on the nightly channel and requires the -Z unstable-options flag to enable.

What does cargo build -- Release do?

cargo run will again compile the code if it notices any change after cargo build command is executed. It also says that cargo build --release command creates the final program, which will run faster.

What does cargo check do?

When no target selection options are given, cargo check will check all binary and library targets of the selected packages. Binaries are skipped if they have required-features that are missing. Passing target selection flags will check only the specified targets.

What is Rust nightly?

A new feature is added to Rust: a new commit lands on the master branch. Each night, a new nightly version of Rust is produced. Every day is a release day, and these releases are created by our release infrastructure automatically. So as time passes, our releases look like this, once a night: nightly: * - - * - - *


1 Answers

According to the documentation it is not possible to specify it in the Cargo.toml file. But you can create a new file called rust-toolchain.toml containing the following:

[toolchain]
channel = "nightly"

For more options look at the section The toolchain file in the same documentation.

like image 167
Sören Avatar answered Sep 27 '22 17:09

Sören