How to tell cargo to use nightly?

Viewed 3978

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.

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.

Related