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.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs
index dfcf346fb..d57c6de70 100644
--- a/crates/hir_ty/src/method_resolution.rs
+++ b/crates/hir_ty/src/method_resolution.rs
@@ -267,7 +267,7 @@ impl Ty {
267 LangItemTarget::ImplDefId(it) => Some(it), 267 LangItemTarget::ImplDefId(it) => Some(it),
268 _ => None, 268 _ => None,
269 }) 269 })
270 .map(|it| it.lookup(db.upcast()).container.module(db.upcast()).krate()) 270 .map(|it| it.lookup(db.upcast()).container.krate())
271 .collect(); 271 .collect();
272 Some(res) 272 Some(res)
273 } 273 }
@@ -528,8 +528,7 @@ fn iterate_trait_method_candidates(
528 self_ty.value.dyn_trait().into_iter().flat_map(|t| all_super_traits(db.upcast(), t)); 528 self_ty.value.dyn_trait().into_iter().flat_map(|t| all_super_traits(db.upcast(), t));
529 let env_traits = if let Ty::Placeholder(_) = self_ty.value { 529 let env_traits = if let Ty::Placeholder(_) = self_ty.value {
530 // if we have `T: Trait` in the param env, the trait doesn't need to be in scope 530 // if we have `T: Trait` in the param env, the trait doesn't need to be in scope
531 env.trait_predicates_for_self_ty(&self_ty.value) 531 env.traits_in_scope_from_clauses(&self_ty.value)
532 .map(|tr| tr.trait_)
533 .flat_map(|t| all_super_traits(db.upcast(), t)) 532 .flat_map(|t| all_super_traits(db.upcast(), t))
534 .collect() 533 .collect()
535 } else { 534 } else {
@@ -588,7 +587,7 @@ fn iterate_inherent_methods(
588 // already happens in `is_valid_candidate` above; if not, we 587 // already happens in `is_valid_candidate` above; if not, we
589 // check it here 588 // check it here
590 if receiver_ty.is_none() && inherent_impl_substs(db, impl_def, self_ty).is_none() { 589 if receiver_ty.is_none() && inherent_impl_substs(db, impl_def, self_ty).is_none() {
591 test_utils::mark::hit!(impl_self_type_match_without_receiver); 590 cov_mark::hit!(impl_self_type_match_without_receiver);
592 continue; 591 continue;
593 } 592 }
594 if callback(&self_ty.value, item) { 593 if callback(&self_ty.value, item) {
@@ -715,7 +714,7 @@ fn transform_receiver_ty(
715 .fill_with_unknown() 714 .fill_with_unknown()
716 .build() 715 .build()
717 } 716 }
718 AssocContainerId::ContainerId(_) => unreachable!(), 717 AssocContainerId::ModuleId(_) => unreachable!(),
719 }; 718 };
720 let sig = db.callable_item_signature(function_id.into()); 719 let sig = db.callable_item_signature(function_id.into());
721 Some(sig.value.params()[0].clone().subst_bound_vars(&substs)) 720 Some(sig.value.params()[0].clone().subst_bound_vars(&substs))