rust-lang / rust-lang/rust-analyzer
local .cargo/config build.target ignored in project of workspace
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
By this document, .cargo/config.toml supports local configuration. So I put .cargo/config in project directory, not in root of workspace.
I put config.toml like below
[build]
target = "wasm32-unknown-unknown"
Because that project was only for wasm32.
It's fine to run cargo check in that project, but rust-analyzer seems not to check the build.target i put in config.toml, so they ignore #[cfg(target_family = "wasm")].
to be clear, i didn't put any .cargo/config in root of workspace.
rust-analyzer version: 0add6e95e 2021-12-20 stable
rustc version: 1.56.1 (59eed8a2a 2021-11-01)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the workspace setup with a project-local .cargo/config.toml containing build.target = "wasm32-unknown-unknown", comparing cargo check with rust-analyzer's diagnostics. Trace how rust-analyzer discovers Cargo configuration for workspace members; done means the project uses the configured target and recognizes the wasm cfg attributes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100