rust-lang / rust-lang/rust-analyzer

Warnings and errors not showing for no_std targets with `allTargets = false`

Open
#11,982 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-no_std C-bug S-unactionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: rust-analyzer version: faaec86ff 2022-04-12 nightly

rustc version: rustc 1.60.0 (7737e0b5c 2022-04-04)

An embedded project of mine has run into a regression with RA in the most recent version that breaks all warning and error reporting.

To get the "no crate found for test" error disabled, I added a .vscode/settings.json with the following item:

{
    "rust-analyzer.checkOnSave.allTargets": false,
}

However, once I've enabled this feature, error and warning reporting completely stops for the entire project.

If I enable all targets, the examples start to report warnings but the lib.rs throws an error about "no crate found for test".

My project is configured with a .cargo/config.toml:

[build]
target = "thumbv7em-none-eabihf"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the stated rust-analyzer and rustc versions, .vscode/settings.json setting checkOnSave.allTargets to false, and .cargo/config.toml targeting thumbv7em-none-eabihf. Compare diagnostics in lib.rs and the examples with all targets enabled and disabled; done means project warnings and errors appear without the reported unwanted test error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.