aboutsummaryrefslogtreecommitdiff
path: root/crates/project_model
diff options
context:
space:
mode:
authorDaniel McNab <[email protected]>2021-03-06 13:56:42 +0000
committerDaniel McNab <[email protected]>2021-03-06 13:56:42 +0000
commit7513867aa21a638eac86c72c8eae0f9ba834380d (patch)
treeadb1cb5206b471ca49d42af2a8e63e5c39d14f05 /crates/project_model
parent1076d21fc0d86ae3b7bb7fca610548fedd42ab4a (diff)
If a manual dependency exists, don't overwrite
This is a hack to work around miri being included in our analysis of rustc-dev Really, we should probably use an include set of the actual root libraries I'm not sure how those are determined however
Diffstat (limited to 'crates/project_model')
-rw-r--r--crates/project_model/src/workspace.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs
index 10e608547..786d7e5ec 100644
--- a/crates/project_model/src/workspace.rs
+++ b/crates/project_model/src/workspace.rs
@@ -507,7 +507,14 @@ fn cargo_to_crate_graph(
507 continue; 507 continue;
508 } 508 }
509 for &from in pkg_crates.get(&pkg).into_iter().flatten() { 509 for &from in pkg_crates.get(&pkg).into_iter().flatten() {
510 add_dep(&mut crate_graph, from, name.clone(), to); 510 if !crate_graph[from].dependencies.iter().any(|d| d.name == name) {
511 add_dep(&mut crate_graph, from, name.clone(), to);
512 } else {
513 // eprintln!(
514 // "Skipped {} for {:?}",
515 // &name, &crate_graph[from].display_name
516 // );
517 }
511 } 518 }
512 } 519 }
513 } 520 }