aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/infer
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/infer')
-rw-r--r--crates/ra_hir/src/ty/infer/path.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/crates/ra_hir/src/ty/infer/path.rs b/crates/ra_hir/src/ty/infer/path.rs
index 1946bf608..59b7f7eb6 100644
--- a/crates/ra_hir/src/ty/infer/path.rs
+++ b/crates/ra_hir/src/ty/infer/path.rs
@@ -196,13 +196,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
196 AssocItem::Const(c) => ValueNs::Const(c), 196 AssocItem::Const(c) => ValueNs::Const(c),
197 AssocItem::TypeAlias(_) => unreachable!(), 197 AssocItem::TypeAlias(_) => unreachable!(),
198 }; 198 };
199 match item.container(self.db) { 199 let substs = match item.container(self.db) {
200 Container::ImplBlock(_) => { 200 Container::ImplBlock(_) => self.find_self_types(&def, ty.clone()),
201 let substs = self.find_self_types(&def, ty.clone());
202
203 self.write_assoc_resolution(id, item);
204 Some((def, substs))
205 }
206 Container::Trait(t) => { 201 Container::Trait(t) => {
207 // we're picking this method 202 // we're picking this method
208 let trait_substs = Substs::build_for_def(self.db, t) 203 let trait_substs = Substs::build_for_def(self.db, t)
@@ -217,11 +212,12 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
217 trait_: t, 212 trait_: t,
218 substs: trait_substs, 213 substs: trait_substs,
219 })); 214 }));
220 215 Some(substs)
221 self.write_assoc_resolution(id, item);
222 Some((def, Some(substs)))
223 } 216 }
224 } 217 };
218
219 self.write_assoc_resolution(id, item);
220 Some((def, substs))
225 }, 221 },
226 ) 222 )
227 } 223 }