diff options
| author | bors <bors@rust-lang.org> | 2022-04-21 14:03:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-04-21 14:03:37 +0000 |
| commit | 71d49d31bbff3d8b0cba267509d33d6b6c1de08f (patch) | |
| tree | 7630e5b71ef59a8c60c8074fb1cbe3a5a7128cbf | |
| parent | f83dce0a4a70e1690fdbd8123d787fbaa6f37970 (diff) | |
| parent | ecb1368027d48af8365f986a181d1b00d805dbaa (diff) | |
| download | rust-71d49d31bbff3d8b0cba267509d33d6b6c1de08f.tar.gz rust-71d49d31bbff3d8b0cba267509d33d6b6c1de08f.zip | |
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 1330a869509..93255705be4 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 { |
