Skip to content

Commit

Permalink
Auto merge of #16911 - Veykril:rustc-crates, r=Veykril
Browse files Browse the repository at this point in the history
fix: Fix projects depending on `rustc_private` hanging

If loading the root fails, we'll hang up in this loop as we never inserted the entry that asserts we already visited a package. This fixes that
Fixes #16902
  • Loading branch information
bors committed Mar 21, 2024
2 parents 20290b2 + 2ad14b8 commit a3d9625
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/project-model/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,7 @@ fn handle_rustc_crates(
let kind @ TargetKind::Lib { is_proc_macro } = rustc_workspace[tgt].kind else {
continue;
};
let pkg_crates = &mut rustc_pkg_crates.entry(pkg).or_insert_with(Vec::new);
if let Some(file_id) = load(&rustc_workspace[tgt].root) {
let crate_id = add_target_crate_root(
crate_graph,
Expand All @@ -1268,7 +1269,7 @@ fn handle_rustc_crates(
if let Some(proc_macro) = libproc_macro {
add_proc_macro_dep(crate_graph, crate_id, proc_macro, is_proc_macro);
}
rustc_pkg_crates.entry(pkg).or_insert_with(Vec::new).push(crate_id);
pkg_crates.push(crate_id);
}
}
}
Expand Down

0 comments on commit a3d9625

Please sign in to comment.