Skip to content

Commit

Permalink
Introduce improvements in deduplicating crates
Browse files Browse the repository at this point in the history
fixes rust-lang#15656 . With this commit we have a more relaxed way
of comparing to crates for equality. If two crates are `almost_equal`
then deduplication takes place.
  • Loading branch information
alibektas committed Oct 1, 2023
1 parent 7af35e3 commit 875d210
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crates/base-db/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,12 +649,6 @@ impl CrateGraph {
});
crate_data.dependencies.sort_by_key(|dep| dep.crate_id);
let res = self.arena.iter().find_map(|(id, data)| {
let name = data.display_name.as_ref().unwrap().crate_name.clone();
let name2 = crate_data.display_name.as_ref().unwrap().crate_name.clone();
if name.to_string() == "std" && name2.to_string() == "std" {
dbg!(data.almost_eq(crate_data), &data, &crate_data);
}

if data.almost_eq(crate_data) {
// If this ever fails then all we need to do is to replace crate_data with data.
assert!(data.origin <= crate_data.origin);
Expand Down

0 comments on commit 875d210

Please sign in to comment.