diff options
Diffstat (limited to 'crates/ra_hir_ty/src/lower.rs')
-rw-r--r-- | crates/ra_hir_ty/src/lower.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs index 52da34574..092977e93 100644 --- a/crates/ra_hir_ty/src/lower.rs +++ b/crates/ra_hir_ty/src/lower.rs | |||
@@ -239,7 +239,10 @@ impl Ty { | |||
239 | ) -> Ty { | 239 | ) -> Ty { |
240 | let ty = match resolution { | 240 | let ty = match resolution { |
241 | TypeNs::TraitId(trait_) => { | 241 | TypeNs::TraitId(trait_) => { |
242 | let trait_ref = TraitRef::from_resolved_path(ctx, trait_, resolved_segment, None); | 242 | // if this is a bare dyn Trait, we'll directly put the required ^0 for the self type in there |
243 | let self_ty = if remaining_segments.len() == 0 { Some(Ty::Bound(0)) } else { None }; | ||
244 | let trait_ref = | ||
245 | TraitRef::from_resolved_path(ctx, trait_, resolved_segment, self_ty); | ||
243 | return if remaining_segments.len() == 1 { | 246 | return if remaining_segments.len() == 1 { |
244 | let segment = remaining_segments.first().unwrap(); | 247 | let segment = remaining_segments.first().unwrap(); |
245 | let associated_ty = associated_type_by_name_including_super_traits( | 248 | let associated_ty = associated_type_by_name_including_super_traits( |