13

The default rust toolchain on the machine is already set to nightly. But rust-analyzer complains about unstable features in vscode.

"#![feature] may not be used on the stable release channel"

It seems that rust-analyzer in vscode doesn't honor the toolchain setting on the machine. Is there a way to switch rust-analyzer from stable to nightly in vscode?

1 Answer 1

21

If your toolchain (and rust-analyzer with it) is managed by rustup you can simply put a toolchain-file in your project directory (next to Cargo.toml) or use any other toolchain override

rust-toolchain.toml:

[toolchain]
channel = "nightly"

You then need to restart any running rust-analyzer instances (for example by reloading VSCode) for it to take effect.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.