diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-23 10:20:47 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-23 10:20:47 +0000 |
commit | 1efd220f2f844596dd22bfd73a8a0c596354be38 (patch) | |
tree | eeba1d8e0e89d6d40ad4802f32dc72af0dfa3e15 /crates/ide_db/src | |
parent | bf3a8eb40a1c684ffc9cb40477558ec276253c3b (diff) | |
parent | fa9c6eb4560c3c72a726dba4210af2edbb3dd4bb (diff) |
Merge #8162
8162: Compute more mathematically well-rounded notion of transitive deps r=Veykril a=matklad
By including the crate itself, we make the resulting set closed with
respect to `transitve_reveres_dependencies` operation, as it becomes a
proper transitive closure. This just feels more proper and mathy.
And, indeed, this actually allows us to simplify call sites somewhat.
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide_db/src')
-rw-r--r-- | crates/ide_db/src/search.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/ide_db/src/search.rs b/crates/ide_db/src/search.rs index 324817cd0..8e93de277 100644 --- a/crates/ide_db/src/search.rs +++ b/crates/ide_db/src/search.rs | |||
@@ -245,9 +245,7 @@ impl Definition { | |||
245 | } | 245 | } |
246 | 246 | ||
247 | if let Some(Visibility::Public) = vis { | 247 | if let Some(Visibility::Public) = vis { |
248 | let source_root_id = db.file_source_root(file_id); | 248 | let mut res = FxHashMap::default(); |
249 | let source_root = db.source_root(source_root_id); | ||
250 | let mut res = source_root.iter().map(|id| (id, None)).collect::<FxHashMap<_, _>>(); | ||
251 | 249 | ||
252 | let krate = module.krate(); | 250 | let krate = module.krate(); |
253 | for rev_dep in krate.transitive_reverse_dependencies(db) { | 251 | for rev_dep in krate.transitive_reverse_dependencies(db) { |