运行 Rust 测试时,IntelliJ 会自动添加 -Z 不稳定选项

ZZZ*_*ZZZ 5 intellij-idea rust

我尝试在 IntelliJ 中运行一个简单的 Rust 测试。

IntelliJ 使用的测试命令是:

cargo test --color=always --package myproject-rust --lib mycode::tests --no-fail-fast -- --format=json -Z unstable-options --show-output
Run Code Online (Sandbox Code Playgroud)

测试失败并出现以下错误:

error: the option `Z` is only accepted on the nightly compiler
Run Code Online (Sandbox Code Playgroud)

看来 IntelliJ 自动-Z unstable-options在命令中添加了 。

我使用测试函数左侧的绿色小播放按钮触发了测试:

在此输入图像描述

我的测试从命令行运行良好。

我无法-Z unstable-options从测试配置中删除它。

我可以做什么来删除它?

Jon*_*nas 0

Rust 1.70 中有一个重大变化,破坏了测试体验。您是否已org.rust.cargo.test.tool.window在“帮助”| 中启用 寻找行动| 实验性功能已启用?如果是,请尝试禁用它。

这样做,并重新启动 IntelliJ 为我解决了这个问题。