aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/autoderef.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/autoderef.rs')
-rw-r--r--crates/ra_hir/src/ty/autoderef.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs
index 5d8518041..b60e4bb31 100644
--- a/crates/ra_hir/src/ty/autoderef.rs
+++ b/crates/ra_hir/src/ty/autoderef.rs
@@ -10,7 +10,7 @@ use hir_expand::name;
10use log::{info, warn}; 10use log::{info, warn};
11 11
12use super::{traits::Solution, Canonical, Substs, Ty, TypeWalk}; 12use super::{traits::Solution, Canonical, Substs, Ty, TypeWalk};
13use crate::{db::HirDatabase, generics::HasGenericParams}; 13use crate::db::HirDatabase;
14 14
15const AUTODEREF_RECURSION_LIMIT: usize = 10; 15const AUTODEREF_RECURSION_LIMIT: usize = 10;
16 16
@@ -46,7 +46,7 @@ fn deref_by_trait(
46 }; 46 };
47 let target = deref_trait.associated_type_by_name(db, &name::TARGET_TYPE)?; 47 let target = deref_trait.associated_type_by_name(db, &name::TARGET_TYPE)?;
48 48
49 let generic_params = target.generic_params(db); 49 let generic_params = db.generic_params(target.id.into());
50 if generic_params.count_params_including_parent() != 1 { 50 if generic_params.count_params_including_parent() != 1 {
51 // the Target type + Deref trait should only have one generic parameter, 51 // the Target type + Deref trait should only have one generic parameter,
52 // namely Deref's Self type 52 // namely Deref's Self type