diff options
Diffstat (limited to 'crates/hir_ty/src/infer/path.rs')
-rw-r--r-- | crates/hir_ty/src/infer/path.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/hir_ty/src/infer/path.rs b/crates/hir_ty/src/infer/path.rs index c9219776b..d55ae4900 100644 --- a/crates/hir_ty/src/infer/path.rs +++ b/crates/hir_ty/src/infer/path.rs | |||
@@ -93,16 +93,13 @@ impl<'a> InferenceContext<'a> { | |||
93 | ValueNs::GenericParam(it) => return Some(self.db.const_param_ty(it)), | 93 | ValueNs::GenericParam(it) => return Some(self.db.const_param_ty(it)), |
94 | }; | 94 | }; |
95 | 95 | ||
96 | let ty = self.db.value_ty(typable); | ||
97 | // self_subst is just for the parent | ||
98 | let parent_substs = self_subst.unwrap_or_else(|| Substitution::empty(&Interner)); | 96 | let parent_substs = self_subst.unwrap_or_else(|| Substitution::empty(&Interner)); |
99 | let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver); | 97 | let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver); |
100 | let substs = ctx.substs_from_path(path, typable, true); | 98 | let substs = ctx.substs_from_path(path, typable, true); |
101 | let full_substs = Substitution::builder(substs.len(&Interner)) | 99 | let ty = TyBuilder::value_ty(self.db, typable) |
102 | .use_parent_substs(&parent_substs) | 100 | .use_parent_substs(&parent_substs) |
103 | .fill(substs.interned(&Interner)[parent_substs.len(&Interner)..].iter().cloned()) | 101 | .fill(substs.interned(&Interner)[parent_substs.len(&Interner)..].iter().cloned()) |
104 | .build(); | 102 | .build(); |
105 | let ty = ty.subst(&full_substs); | ||
106 | Some(ty) | 103 | Some(ty) |
107 | } | 104 | } |
108 | 105 | ||