rust-lang / rust-lang/rust-analyzer

Support for separate .cargo/config.toml files in different projects in a workspace.

Open
#16,765 2 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-cargo A-project-model C-feature
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

The problem is if you have a workspace with subprojects that have different targets, they are not handled separately.

I created a reposity demonstrating the problem - https://github.com/ryankopf/testconfig

This is a problem because if you have a project, such as a video game, where you have two different targets (in my case one is wasm and one is linux/windows), Rust-Analyzer will die when it encounters a "compile_error!" macro in one of the projects, because the .cargo/config.toml file is not read for that project, and so Rust-Analyzer is not appropriately including the proper target in its checks.

This may be related to this issue - https://github.com/rust-lang/rust-analyzer/issues/13529 - but I think support for config.toml files is a separate issue that should be included.

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

Start with the linked reproduction repository to observe how separate workspace subprojects use different targets, then trace rust-analyzer's workspace and .cargo/config.toml handling. Done means each subproject's configuration is read independently so its target-specific checks no longer produce an incorrect compile_error!.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.