生锈分析器:写入请求失败:管道损坏(os 错误 32)

rust-analyzer: Failed to write request: Broken pipe (os error 32)

使用 rust-analyzer VS Code 时出现此错误,尽管 cargo build 构建项目时没有错误或警告。

rustc版本:1.54.0

我想继续使用“稳定”rustc 版本, 切换到“夜间”。

更新 rustc 以修复此问题并确保 Visual Studio 代码使用正确的 Rust 编译器。

  1. 运行 rustup update 更新 rustc
  2. 检查 rust-analyzer 使用的版本:确保 ctrl+p -> Rust Analyzer: Show RA Version 显示 rust-analyzer version: 183ef048f 2021-11-22 stable
  3. 运行 cargo clean 清除过时的编译器输出
  4. 关闭 所有 VS Code windows 并再次打开它们。

这应该可以解决问题。如果没有,看看here.