Skip to content

Pass --bin to cargo check when a binary is changed #17829

Closed
@mo8it

Description

@mo8it

I marked this as important because it affects Rust beginners and I don't want them to get a bad expression while learning with Rustlings. It causes Rustlings to freeze for a long time because Rust-Analyzer blocks Cargo.

The issue is described here with a video: rust-lang/rustlings#2071

I was able to reproduce it in VS-Code in a Windows 10 VM (probably not a Windows problem, didn't test on Linux).

You don't even need to have Rustlings running in the background to see how Rust-Analyzer rebuilds everything on every file save:

  • Initialize Rustlings with rustlings inti
  • Open VS-Code in the generated rustlings/ directory
  • Wait for Rust-Analyzer to be done
  • Open a file and trigger a save
  • See that Rust-Analyzer rebuilds all 188 binaries!

It looks like an issue in the Rust-Analyzer VS-Code plugin because it doesn't happen in Helix in the same VM.

The effect probably became more dramatic after I added --keep-going in #17561

Metadata

Metadata

Assignees

Labels

A-flycheckissues with flycheck a.k.a. "check on save"C-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions