diff options
Diffstat (limited to 'crates/ra_hir_ty/src/autoderef.rs')
-rw-r--r-- | crates/ra_hir_ty/src/autoderef.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir_ty/src/autoderef.rs b/crates/ra_hir_ty/src/autoderef.rs index 9d1d4e48c..d557962b4 100644 --- a/crates/ra_hir_ty/src/autoderef.rs +++ b/crates/ra_hir_ty/src/autoderef.rs | |||
@@ -10,10 +10,10 @@ use hir_expand::name; | |||
10 | use log::{info, warn}; | 10 | use log::{info, warn}; |
11 | use ra_db::CrateId; | 11 | use ra_db::CrateId; |
12 | 12 | ||
13 | use crate::db::HirDatabase; | 13 | use crate::{ |
14 | 14 | db::HirDatabase, | |
15 | use super::{ | ||
16 | traits::{InEnvironment, Solution}, | 15 | traits::{InEnvironment, Solution}, |
16 | utils::generics, | ||
17 | Canonical, Substs, Ty, TypeWalk, | 17 | Canonical, Substs, Ty, TypeWalk, |
18 | }; | 18 | }; |
19 | 19 | ||
@@ -54,8 +54,8 @@ fn deref_by_trait( | |||
54 | }; | 54 | }; |
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 = db.generic_params(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; |