Search code examples
rustrust-cargo

Set a project to use nightly by default


How do I set a Cargo project to build & run using nightly by default (i.e. cargo build is actually cargo +nightly build) without setting nightly as the global default?


This is not the same question as How to switch between Rust toolchains. If you read both questions you'll see that question is asking about switching Rust toolchains globally whereas I want to switch Rust toolchains without changing the global setting.


Solution

  • With rustup override set nightly it sets the default for that directory to nightly:

    https://rust-lang.github.io/rustup/overrides.html#directory-overrides