Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit a3d9625

Browse files
committed
Auto merge of rust-lang#16911 - Veykril:rustc-crates, r=Veykril
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 rust-lang/rust-analyzer#16902
2 parents 20290b2 + 2ad14b8 commit a3d9625

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/project-model/src/workspace.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,7 @@ fn handle_rustc_crates(
12501250
let kind @ TargetKind::Lib { is_proc_macro } = rustc_workspace[tgt].kind else {
12511251
continue;
12521252
};
1253+
let pkg_crates = &mut rustc_pkg_crates.entry(pkg).or_insert_with(Vec::new);
12531254
if let Some(file_id) = load(&rustc_workspace[tgt].root) {
12541255
let crate_id = add_target_crate_root(
12551256
crate_graph,
@@ -1268,7 +1269,7 @@ fn handle_rustc_crates(
12681269
if let Some(proc_macro) = libproc_macro {
12691270
add_proc_macro_dep(crate_graph, crate_id, proc_macro, is_proc_macro);
12701271
}
1271-
rustc_pkg_crates.entry(pkg).or_insert_with(Vec::new).push(crate_id);
1272+
pkg_crates.push(crate_id);
12721273
}
12731274
}
12741275
}

0 commit comments

Comments
 (0)