diff options
-rw-r--r-- | crates/project_model/src/workspace.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs index 695fac398..cacf462cf 100644 --- a/crates/project_model/src/workspace.rs +++ b/crates/project_model/src/workspace.rs | |||
@@ -453,6 +453,9 @@ fn cargo_to_crate_graph( | |||
453 | let mut queue = VecDeque::new(); | 453 | let mut queue = VecDeque::new(); |
454 | queue.push_back(root_pkg); | 454 | queue.push_back(root_pkg); |
455 | while let Some(pkg) = queue.pop_front() { | 455 | while let Some(pkg) = queue.pop_front() { |
456 | if rustc_pkg_crates.contains_key(&pkg) { | ||
457 | continue; | ||
458 | } | ||
456 | for dep in &rustc_workspace[pkg].dependencies { | 459 | for dep in &rustc_workspace[pkg].dependencies { |
457 | queue.push_back(dep.pkg); | 460 | queue.push_back(dep.pkg); |
458 | } | 461 | } |
@@ -481,7 +484,7 @@ fn cargo_to_crate_graph( | |||
481 | } | 484 | } |
482 | // Now add a dep edge from all targets of upstream to the lib | 485 | // Now add a dep edge from all targets of upstream to the lib |
483 | // target of downstream. | 486 | // target of downstream. |
484 | for pkg in rustc_workspace.packages() { | 487 | for pkg in rustc_pkg_crates.keys().copied() { |
485 | for dep in rustc_workspace[pkg].dependencies.iter() { | 488 | for dep in rustc_workspace[pkg].dependencies.iter() { |
486 | let name = CrateName::new(&dep.name).unwrap(); | 489 | let name = CrateName::new(&dep.name).unwrap(); |
487 | if let Some(&to) = pkg_to_lib_crate.get(&dep.pkg) { | 490 | if let Some(&to) = pkg_to_lib_crate.get(&dep.pkg) { |
@@ -519,6 +522,8 @@ fn cargo_to_crate_graph( | |||
519 | } | 522 | } |
520 | } | 523 | } |
521 | } | 524 | } |
525 | } else { | ||
526 | eprintln!("No cargo workspace"); | ||
522 | } | 527 | } |
523 | crate_graph | 528 | crate_graph |
524 | } | 529 | } |