diff options
Diffstat (limited to 'crates/ra_hir/src/ty/lower.rs')
-rw-r--r-- | crates/ra_hir/src/ty/lower.rs | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index f6f0137cf..480bae740 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs | |||
@@ -132,14 +132,16 @@ impl Ty { | |||
132 | if let Some(remaining_index) = remaining_index { | 132 | if let Some(remaining_index) = remaining_index { |
133 | if remaining_index == path.segments.len() - 1 { | 133 | if remaining_index == path.segments.len() - 1 { |
134 | let segment = &path.segments[remaining_index]; | 134 | let segment = &path.segments[remaining_index]; |
135 | let associated_ty = | 135 | let associated_ty = match trait_ref |
136 | match trait_ref.trait_.associated_type_by_name(db, segment.name.clone()) { | 136 | .trait_ |
137 | Some(t) => t, | 137 | .associated_type_by_name_including_super_traits(db, &segment.name) |
138 | None => { | 138 | { |
139 | // associated type not found | 139 | Some(t) => t, |
140 | return Ty::Unknown; | 140 | None => { |
141 | } | 141 | // associated type not found |
142 | }; | 142 | return Ty::Unknown; |
143 | } | ||
144 | }; | ||
143 | // FIXME handle type parameters on the segment | 145 | // FIXME handle type parameters on the segment |
144 | Ty::Projection(ProjectionTy { associated_ty, parameters: trait_ref.substs }) | 146 | Ty::Projection(ProjectionTy { associated_ty, parameters: trait_ref.substs }) |
145 | } else { | 147 | } else { |
@@ -387,10 +389,11 @@ fn assoc_type_bindings_from_type_bound<'a>( | |||
387 | .flat_map(|segment| segment.args_and_bindings.iter()) | 389 | .flat_map(|segment| segment.args_and_bindings.iter()) |
388 | .flat_map(|args_and_bindings| args_and_bindings.bindings.iter()) | 390 | .flat_map(|args_and_bindings| args_and_bindings.bindings.iter()) |
389 | .map(move |(name, type_ref)| { | 391 | .map(move |(name, type_ref)| { |
390 | let associated_ty = match trait_ref.trait_.associated_type_by_name(db, name.clone()) { | 392 | let associated_ty = |
391 | None => return GenericPredicate::Error, | 393 | match trait_ref.trait_.associated_type_by_name_including_super_traits(db, &name) { |
392 | Some(t) => t, | 394 | None => return GenericPredicate::Error, |
393 | }; | 395 | Some(t) => t, |
396 | }; | ||
394 | let projection_ty = | 397 | let projection_ty = |
395 | ProjectionTy { associated_ty, parameters: trait_ref.substs.clone() }; | 398 | ProjectionTy { associated_ty, parameters: trait_ref.substs.clone() }; |
396 | let ty = Ty::from_hir(db, resolver, type_ref); | 399 | let ty = Ty::from_hir(db, resolver, type_ref); |