aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/autoderef.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-07 12:05:05 +0000
committerAleksey Kladov <[email protected]>2019-12-07 12:13:00 +0000
commitd6c2b92409902d9ceca8cd064026cfcc1f357cf6 (patch)
tree8ce9fd29435ef3bf1fe568fd889c3f1ab8307ea6 /crates/ra_hir_ty/src/autoderef.rs
parent8e9837df21942ca12a5aece0a868ea46eb405742 (diff)
Refactor parameter count tracking
Diffstat (limited to 'crates/ra_hir_ty/src/autoderef.rs')
-rw-r--r--crates/ra_hir_ty/src/autoderef.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir_ty/src/autoderef.rs b/crates/ra_hir_ty/src/autoderef.rs
index a6db7f623..d557962b4 100644
--- a/crates/ra_hir_ty/src/autoderef.rs
+++ b/crates/ra_hir_ty/src/autoderef.rs
@@ -55,7 +55,7 @@ fn deref_by_trait(
55 let target = db.trait_data(deref_trait).associated_type_by_name(&name::TARGET_TYPE)?; 55 let target = db.trait_data(deref_trait).associated_type_by_name(&name::TARGET_TYPE)?;
56 56
57 let generic_params = generics(db, target.into()); 57 let generic_params = generics(db, target.into());
58 if generic_params.count_params_including_parent() != 1 { 58 if generic_params.len() != 1 {
59 // the Target type + Deref trait should only have one generic parameter, 59 // the Target type + Deref trait should only have one generic parameter,
60 // namely Deref's Self type 60 // namely Deref's Self type
61 return None; 61 return None;