pub(crate) fn impls_for_trait_query(
    db: &impl HirDatabase,
    krate: CrateId,
    trait_: TraitId,
) -> Arc<[ImplId]> {
    let mut impls = FxHashSet::default();
    // We call the query recursively here. On the one hand, this means we can
    // reuse results from queries for different crates; on the other hand, this
    // will only ever get called for a few crates near the root of the tree (the
    // ones the user is editing), so this may actually be a waste of memory. I'm
    // doing it like this mainly for simplicity for now.
    for dep in db.crate_graph().dependencies(krate) {
        impls.extend(db.impls_for_trait(dep.crate_id, trait_).iter());
    }
    let crate_impl_blocks = db.impls_in_crate(krate);
    impls.extend(crate_impl_blocks.lookup_impl_blocks_for_trait(trait_));
    impls.into_iter().collect()
}
/// Collects impls for the given trait in the whole dependency tree of `krate`.
Collects impls for the given trait in the whole dependency tree of `krate`.
Collects impls for the given trait in the whole dependency tree of ` krate ` .
pub(crate) fn impls_for_trait_query(
    db: &impl HirDatabase,
    krate: CrateId,
    trait_: TraitId,
) -> Arc<[ImplId]> {
    let mut impls = FxHashSet::default();
    // We call the query recursively here. On the one hand, this means we can
    // reuse results from queries for different crates; on the other hand, this
    // will only ever get called for a few crates near the root of the tree (the
    // ones the user is editing), so this may actually be a waste of memory. I'm
    // doing it like this mainly for simplicity for now.
    for dep in db.crate_graph().dependencies(krate) {
        impls.extend(db.impls_for_trait(dep.crate_id, trait_).iter());
    }
    let crate_impl_blocks = db.impls_in_crate(krate);
    impls.extend(crate_impl_blocks.lookup_impl_blocks_for_trait(trait_));
    impls.into_iter().collect()
}
pub ( crate ) fn impls_for_trait_query ( db : & impl HirDatabase , krate : CrateId , trait_ : TraitId , ) -> Arc < [ ImplId ] > { let mut impls = FxHashSet :: default ( ) ; // We call the query recursively here. On the one hand, this means we can // reuse results from queries for different crates; on the other hand, this // will only ever get called for a few crates near the root of the tree (the // ones the user is editing), so this may actually be a waste of memory. I'm // doing it like this mainly for simplicity for now. for dep in db . crate_graph ( ) . dependencies ( krate ) { impls . extend ( db . impls_for_trait ( dep . crate_id , trait_ ) . iter ( ) ) ; } let crate_impl_blocks = db . impls_in_crate ( krate ) ; impls . extend ( crate_impl_blocks . lookup_impl_blocks_for_trait ( trait_ ) ) ; impls . into_iter ( ) . collect ( ) }
Collects impls for the given trait in the whole dependency tree of `krate`.
Collects impls for the given trait in the whole dependency tree of ` krate ` .
db
&impl HirDatabase
krate
CrateId
trait_
TraitId