rust-analyzer: cargo check output not showing up

After upgrading to 0.2.166 I no longer see cargo check output in the edit pane.

The extension now runs cargo check almost immediately after each edit (and not just upon save) which is good because that cargo check comes back quickly enough.

However, none of the errors, including clippy warnings, are showing up. They are just silently swallowed.

I have to manually run cargo check on the command line and manually Ctrl-Click each error position to get there. The errors are no longer red-underlined. I wonder what has happened.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 38 (19 by maintainers)

Most upvoted comments

@obmarg since schungx closed this issue and yours seems to be unrelated, can you please file a new one with the relevant details (repository URL, screenshots and so on)?

There happens to be a feature in my Cargo.toml that requires nightly

By default rust-analyzer passes --all-features to cargo check. You can use "rust-analyzer.cargo.allFeatures": false to prevent this.

@obmarg I figured it out.

There happens to be a feature in my Cargo.toml that requires nightly, and my default toolchain is stable. This seems to be killing the cargo check. This seems to be the case even if the crate is pulled in only under a feature flag, as cargo check seems to be checking it also.

Downgraded to 0.2.159 and it works fine. So it is something to do with version 0.2.166

There is another anomaly: In 0.2.159, when clicking on Run Test, it only compiles the test file in question. In 0.2.166, when clicking on Run Test, it compiles all the test files.