aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/method_resolution.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/method_resolution.rs')
-rw-r--r--crates/hir_ty/src/method_resolution.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs
index f301a8477..dfcf346fb 100644
--- a/crates/hir_ty/src/method_resolution.rs
+++ b/crates/hir_ty/src/method_resolution.rs
@@ -8,8 +8,8 @@ use arrayvec::ArrayVec;
8use base_db::CrateId; 8use base_db::CrateId;
9use chalk_ir::Mutability; 9use chalk_ir::Mutability;
10use hir_def::{ 10use hir_def::{
11 lang_item::LangItemTarget, AdtId, AssocContainerId, AssocItemId, FunctionId, GenericDefId, 11 lang_item::LangItemTarget, AssocContainerId, AssocItemId, FunctionId, GenericDefId, HasModule,
12 HasModule, ImplId, Lookup, ModuleId, TraitId, TypeAliasId, 12 ImplId, Lookup, ModuleId, TraitId, TypeAliasId,
13}; 13};
14use hir_expand::name::Name; 14use hir_expand::name::Name;
15use rustc_hash::{FxHashMap, FxHashSet}; 15use rustc_hash::{FxHashMap, FxHashSet};
@@ -19,8 +19,8 @@ use crate::{
19 db::HirDatabase, 19 db::HirDatabase,
20 primitive::{self, FloatTy, IntTy, UintTy}, 20 primitive::{self, FloatTy, IntTy, UintTy},
21 utils::all_super_traits, 21 utils::all_super_traits,
22 Canonical, DebruijnIndex, FnPointer, FnSig, InEnvironment, Scalar, Substs, TraitEnvironment, 22 AdtId, Canonical, DebruijnIndex, FnPointer, FnSig, InEnvironment, Scalar, Substs,
23 TraitRef, Ty, TypeWalk, 23 TraitEnvironment, TraitRef, Ty, TypeWalk,
24}; 24};
25 25
26/// This is used as a key for indexing impls. 26/// This is used as a key for indexing impls.
@@ -32,7 +32,7 @@ pub enum TyFingerprint {
32 Never, 32 Never,
33 RawPtr(Mutability), 33 RawPtr(Mutability),
34 Scalar(Scalar), 34 Scalar(Scalar),
35 Adt(AdtId), 35 Adt(hir_def::AdtId),
36 Dyn(TraitId), 36 Dyn(TraitId),
37 Tuple(usize), 37 Tuple(usize),
38 ForeignType(TypeAliasId), 38 ForeignType(TypeAliasId),
@@ -50,7 +50,7 @@ impl TyFingerprint {
50 &Ty::Slice(..) => TyFingerprint::Slice, 50 &Ty::Slice(..) => TyFingerprint::Slice,
51 &Ty::Array(..) => TyFingerprint::Array, 51 &Ty::Array(..) => TyFingerprint::Array,
52 &Ty::Scalar(scalar) => TyFingerprint::Scalar(scalar), 52 &Ty::Scalar(scalar) => TyFingerprint::Scalar(scalar),
53 &Ty::Adt(adt, _) => TyFingerprint::Adt(adt), 53 &Ty::Adt(AdtId(adt), _) => TyFingerprint::Adt(adt),
54 &Ty::Tuple(cardinality, _) => TyFingerprint::Tuple(cardinality), 54 &Ty::Tuple(cardinality, _) => TyFingerprint::Tuple(cardinality),
55 &Ty::Raw(mutability, ..) => TyFingerprint::RawPtr(mutability), 55 &Ty::Raw(mutability, ..) => TyFingerprint::RawPtr(mutability),
56 &Ty::ForeignType(alias_id, ..) => TyFingerprint::ForeignType(alias_id), 56 &Ty::ForeignType(alias_id, ..) => TyFingerprint::ForeignType(alias_id),
@@ -231,7 +231,7 @@ impl Ty {
231 let mod_to_crate_ids = |module: ModuleId| Some(std::iter::once(module.krate()).collect()); 231 let mod_to_crate_ids = |module: ModuleId| Some(std::iter::once(module.krate()).collect());
232 232
233 let lang_item_targets = match self { 233 let lang_item_targets = match self {
234 Ty::Adt(def_id, _) => { 234 Ty::Adt(AdtId(def_id), _) => {
235 return mod_to_crate_ids(def_id.module(db.upcast())); 235 return mod_to_crate_ids(def_id.module(db.upcast()));
236 } 236 }
237 Ty::ForeignType(type_alias_id) => { 237 Ty::ForeignType(type_alias_id) => {