aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/hir/src/lib.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 42a805c57..d13b4d5fd 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -1488,7 +1488,7 @@ impl Impl {
1488 pub fn all_for_type(db: &dyn HirDatabase, Type { krate, ty }: Type) -> Vec<Impl> { 1488 pub fn all_for_type(db: &dyn HirDatabase, Type { krate, ty }: Type) -> Vec<Impl> {
1489 let def_crates = match ty.value.def_crates(db, krate) { 1489 let def_crates = match ty.value.def_crates(db, krate) {
1490 Some(def_crates) => def_crates, 1490 Some(def_crates) => def_crates,
1491 None => return vec![], 1491 None => return Vec::new(),
1492 }; 1492 };
1493 1493
1494 let filter = |impl_def: &Impl| { 1494 let filter = |impl_def: &Impl| {
@@ -1498,16 +1498,11 @@ impl Impl {
1498 }; 1498 };
1499 1499
1500 let mut all = Vec::new(); 1500 let mut all = Vec::new();
1501 def_crates.iter().for_each(|&id| { 1501 def_crates.into_iter().for_each(|id| {
1502 all.extend(db.inherent_impls_in_crate(id).all_impls().map(Self::from).filter(filter)) 1502 all.extend(db.inherent_impls_in_crate(id).all_impls().map(Self::from).filter(filter))
1503 }); 1503 });
1504 let fp = TyFingerprint::for_impl(&ty.value); 1504 let fp = TyFingerprint::for_impl(&ty.value);
1505 for id in def_crates 1505 for id in db.crate_graph().iter() {
1506 .iter()
1507 .flat_map(|&id| Crate { id }.reverse_dependencies(db))
1508 .map(|Crate { id }| id)
1509 .chain(def_crates.iter().copied())
1510 {
1511 match fp { 1506 match fp {
1512 Some(fp) => all.extend( 1507 Some(fp) => all.extend(
1513 db.trait_impls_in_crate(id).for_self_ty(fp).map(Self::from).filter(filter), 1508 db.trait_impls_in_crate(id).for_self_ty(fp).map(Self::from).filter(filter),