diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-26 22:04:20 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-26 22:04:20 +0100 |
commit | fc218ec0d04577e33db509e956a044293c12ea67 (patch) | |
tree | 2229733948df98f119aee5eca600a50726192c68 /crates/ra_hir/src/ty/infer/path.rs | |
parent | 1002e470747fe5887a2915689e21d9be3a1ca5d8 (diff) | |
parent | daaf46177e5dc63e20e5a1ec5692e53cc8f7bc34 (diff) |
Merge #1923
1923: Add SubstsBuilder r=flodiebold a=flodiebold
+ further refactoring.
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/infer/path.rs')
-rw-r--r-- | crates/ra_hir/src/ty/infer/path.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir/src/ty/infer/path.rs b/crates/ra_hir/src/ty/infer/path.rs index feb7481b2..db979353a 100644 --- a/crates/ra_hir/src/ty/infer/path.rs +++ b/crates/ra_hir/src/ty/infer/path.rs | |||
@@ -158,13 +158,13 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
158 | AssocItem::Const(c) => ValueNs::Const(c), | 158 | AssocItem::Const(c) => ValueNs::Const(c), |
159 | AssocItem::TypeAlias(_) => unreachable!(), | 159 | AssocItem::TypeAlias(_) => unreachable!(), |
160 | }; | 160 | }; |
161 | let generics = item.generic_params(self.db); | 161 | let substs = Substs::build_for_def(self.db, item) |
162 | let mut substs = Vec::with_capacity(generics.count_params_including_parent()); | 162 | .use_parent_substs(&trait_ref.substs) |
163 | substs.extend(trait_ref.substs.iter().cloned()); | 163 | .fill_with_unknown() |
164 | substs.extend(std::iter::repeat(Ty::Unknown).take(generics.params.len())); | 164 | .build(); |
165 | 165 | ||
166 | self.write_assoc_resolution(id, item); | 166 | self.write_assoc_resolution(id, item); |
167 | Some((def, Some(substs.into()))) | 167 | Some((def, Some(substs))) |
168 | } | 168 | } |
169 | 169 | ||
170 | fn resolve_ty_assoc_item( | 170 | fn resolve_ty_assoc_item( |