diff options
author | Edwin Cheng <[email protected]> | 2019-12-24 15:39:44 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-12-24 16:12:29 +0000 |
commit | 42813126d92cc1fb145e75752b5a95d884ea9a12 (patch) | |
tree | eb322406ccd19990c4dca50f24b9ccf31c13fd06 /crates/ra_hir_ty/src | |
parent | 3a2cf708ed1c80d403af957791dfe35ad5dee0a3 (diff) |
Check if parameters is empty
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r-- | crates/ra_hir_ty/src/infer.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index e40df65e3..32c0d07a5 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs | |||
@@ -387,10 +387,12 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
387 | if let Ty::Opaque(ref predicates) = inner_ty { | 387 | if let Ty::Opaque(ref predicates) = inner_ty { |
388 | for p in predicates.iter() { | 388 | for p in predicates.iter() { |
389 | if let GenericPredicate::Projection(projection) = p { | 389 | if let GenericPredicate::Projection(projection) = p { |
390 | if projection.projection_ty.associated_ty == res_assoc_ty | 390 | if projection.projection_ty.associated_ty == res_assoc_ty { |
391 | && projection.ty != Ty::Unknown | 391 | if let ty_app!(_, params) = &projection.ty { |
392 | { | 392 | if params.len() == 0 { |
393 | return projection.ty.clone(); | 393 | return projection.ty.clone(); |
394 | } | ||
395 | } | ||
394 | } | 396 | } |
395 | } | 397 | } |
396 | } | 398 | } |