From 7513867aa21a638eac86c72c8eae0f9ba834380d Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Sat, 6 Mar 2021 13:56:42 +0000 Subject: 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 --- crates/project_model/src/workspace.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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( continue; } for &from in pkg_crates.get(&pkg).into_iter().flatten() { - add_dep(&mut crate_graph, from, name.clone(), to); + if !crate_graph[from].dependencies.iter().any(|d| d.name == name) { + add_dep(&mut crate_graph, from, name.clone(), to); + } else { + // eprintln!( + // "Skipped {} for {:?}", + // &name, &crate_graph[from].display_name + // ); + } } } } -- cgit v1.2.3