aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/method_resolution.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/method_resolution.rs')
-rw-r--r--crates/ra_hir/src/ty/method_resolution.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs
index bb23246a6..aac7d6384 100644
--- a/crates/ra_hir/src/ty/method_resolution.rs
+++ b/crates/ra_hir/src/ty/method_resolution.rs
@@ -72,9 +72,9 @@ impl CrateImplBlocks {
72 72
73 let target_ty = impl_block.target_ty(db); 73 let target_ty = impl_block.target_ty(db);
74 74
75 if let Some(tr) = impl_block.target_trait(db) { 75 if let Some(tr) = impl_block.target_trait_ref(db) {
76 self.impls_by_trait 76 self.impls_by_trait
77 .entry(tr) 77 .entry(tr.trait_)
78 .or_insert_with(Vec::new) 78 .or_insert_with(Vec::new)
79 .push((module.module_id, impl_id)); 79 .push((module.module_id, impl_id));
80 } else { 80 } else {
@@ -185,6 +185,8 @@ impl Ty {
185 // well (in fact, the 'implements' condition could just be considered a 185 // well (in fact, the 'implements' condition could just be considered a
186 // 'where Self: Trait' clause) 186 // 'where Self: Trait' clause)
187 candidates.retain(|(t, _m)| { 187 candidates.retain(|(t, _m)| {
188 // FIXME construct substs of the correct length for the trait
189 // - check in rustc whether it does anything smarter than putting variables for everything
188 let trait_ref = TraitRef { trait_: *t, substs: Substs::single(self.clone()) }; 190 let trait_ref = TraitRef { trait_: *t, substs: Substs::single(self.clone()) };
189 db.implements(trait_ref) 191 db.implements(trait_ref)
190 }); 192 });