Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #12044 - tedinski:fix_rustc_workspace, r=jonas-schievink
fix: index the correct CargoWorkspace with rustc_private
I believe this fixes #12043, but I'm not sufficiently setup/familiar with working on rust-analyzer to test it locally. :/
This section of code is iterating on `rustc_workspace.packages()` but then indexes `cargo[pkg]`, which is likely the source of the bug.
| -rw-r--r-- | crates/project_model/src/workspace.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs index 1330a86950..93255705be 100644 --- a/crates/project_model/src/workspace.rs +++ b/crates/project_model/src/workspace.rs @@ -759,7 +759,9 @@ fn handle_rustc_crates( let overrides = match override_cfg { CfgOverrides::Wildcard(cfg_diff) => Some(cfg_diff), - CfgOverrides::Selective(cfg_overrides) => cfg_overrides.get(&cargo[pkg].name), + CfgOverrides::Selective(cfg_overrides) => { + cfg_overrides.get(&rustc_workspace[pkg].name) + } }; if let Some(overrides) = overrides { |