aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/autoderef.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/autoderef.rs')
-rw-r--r--crates/ra_hir_ty/src/autoderef.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/autoderef.rs b/crates/ra_hir_ty/src/autoderef.rs
index f32d5786a..53e81e85d 100644
--- a/crates/ra_hir_ty/src/autoderef.rs
+++ b/crates/ra_hir_ty/src/autoderef.rs
@@ -20,7 +20,7 @@ use crate::{
20const AUTODEREF_RECURSION_LIMIT: usize = 10; 20const AUTODEREF_RECURSION_LIMIT: usize = 10;
21 21
22pub fn autoderef<'a>( 22pub fn autoderef<'a>(
23 db: &'a impl HirDatabase, 23 db: &'a dyn HirDatabase,
24 krate: Option<CrateId>, 24 krate: Option<CrateId>,
25 ty: InEnvironment<Canonical<Ty>>, 25 ty: InEnvironment<Canonical<Ty>>,
26) -> impl Iterator<Item = Canonical<Ty>> + 'a { 26) -> impl Iterator<Item = Canonical<Ty>> + 'a {
@@ -32,7 +32,7 @@ pub fn autoderef<'a>(
32} 32}
33 33
34pub(crate) fn deref( 34pub(crate) fn deref(
35 db: &impl HirDatabase, 35 db: &dyn HirDatabase,
36 krate: CrateId, 36 krate: CrateId,
37 ty: InEnvironment<&Canonical<Ty>>, 37 ty: InEnvironment<&Canonical<Ty>>,
38) -> Option<Canonical<Ty>> { 38) -> Option<Canonical<Ty>> {
@@ -44,7 +44,7 @@ pub(crate) fn deref(
44} 44}
45 45
46fn deref_by_trait( 46fn deref_by_trait(
47 db: &impl HirDatabase, 47 db: &dyn HirDatabase,
48 krate: CrateId, 48 krate: CrateId,
49 ty: InEnvironment<&Canonical<Ty>>, 49 ty: InEnvironment<&Canonical<Ty>>,
50) -> Option<Canonical<Ty>> { 50) -> Option<Canonical<Ty>> {
@@ -54,7 +54,7 @@ fn deref_by_trait(
54 }; 54 };
55 let target = db.trait_data(deref_trait).associated_type_by_name(&name![Target])?; 55 let target = db.trait_data(deref_trait).associated_type_by_name(&name![Target])?;
56 56
57 let generic_params = generics(db, target.into()); 57 let generic_params = generics(db.upcast(), target.into());
58 if generic_params.len() != 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