Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/db.rs')
-rw-r--r--crates/hir-ty/src/db.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/crates/hir-ty/src/db.rs b/crates/hir-ty/src/db.rs
index 932fce8356..ae6bf786cf 100644
--- a/crates/hir-ty/src/db.rs
+++ b/crates/hir-ty/src/db.rs
@@ -3,13 +3,13 @@
use std::sync::Arc;
-use arrayvec::ArrayVec;
use base_db::{impl_intern_key, salsa, CrateId, Upcast};
use hir_def::{
db::DefDatabase, expr::ExprId, BlockId, ConstId, ConstParamId, DefWithBodyId, EnumVariantId,
FunctionId, GenericDefId, ImplId, LifetimeParamId, LocalFieldId, TypeOrConstParamId, VariantId,
};
use la_arena::ArenaMap;
+use smallvec::SmallVec;
use crate::{
chalk_db,
@@ -92,10 +92,15 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
fn inherent_impls_in_block(&self, block: BlockId) -> Option<Arc<InherentImpls>>;
/// Collects all crates in the dependency graph that have impls for the
- /// given fingerprint. This is only used for primitive types; for
- /// user-defined types we just look at the crate where the type is defined.
- #[salsa::invoke(crate::method_resolution::inherent_impl_crates_query)]
- fn inherent_impl_crates(&self, krate: CrateId, fp: TyFingerprint) -> ArrayVec<CrateId, 2>;
+ /// given fingerprint. This is only used for primitive types and types
+ /// annotated with `rustc_has_incoherent_inherent_impls`; for other types
+ /// we just look at the crate where the type is defined.
+ #[salsa::invoke(crate::method_resolution::incoherent_inherent_impl_crates)]
+ fn incoherent_inherent_impl_crates(
+ &self,
+ krate: CrateId,
+ fp: TyFingerprint,
+ ) -> SmallVec<[CrateId; 2]>;
#[salsa::invoke(TraitImpls::trait_impls_in_crate_query)]
fn trait_impls_in_crate(&self, krate: CrateId) -> Arc<TraitImpls>;