如何在 vscode 中将 rust-analyzer 从稳定版切换到夜间版?

use*_*970 6 rust vscode-extensions

机器上默认的 Rust 工具链已设置为每晚。但 rust-analyzer 抱怨 vscode 中的不稳定功能。

"#![feature] may not be used on the stable release channel"
Run Code Online (Sandbox Code Playgroud)

看来 vscode 中的 rust-analyzer 不支持机器上的工具链设置。有没有办法在 vscode 中将 rust-analyzer 从稳定版切换到夜间版?

caf*_*e25 11

如果您的工具链(及其rust-analyzer)由您管理,rustup您只需将工具链文件放入项目目录(旁边Cargo.toml)或使用任何其他工具链覆盖

rust-toolchain.toml:

[toolchain]
channel = "nightly"
Run Code Online (Sandbox Code Playgroud)