aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/autoderef.rs
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-04-14 14:59:08 +0100
committerKirill Bulatov <[email protected]>2021-04-14 14:59:08 +0100
commit3390e738164b0c112a028f3967bf13915023e167 (patch)
tree6475b1455992f93aa77c61ff793d457082a749dc /crates/hir_ty/src/autoderef.rs
parentd1fc9d727be6f39d5511cf4c5125b40489dfd6be (diff)
We need to go deeper
Diffstat (limited to 'crates/hir_ty/src/autoderef.rs')
-rw-r--r--crates/hir_ty/src/autoderef.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/hir_ty/src/autoderef.rs b/crates/hir_ty/src/autoderef.rs
index 7afa2d5ce..eae0ad949 100644
--- a/crates/hir_ty/src/autoderef.rs
+++ b/crates/hir_ty/src/autoderef.rs
@@ -58,6 +58,7 @@ fn deref_by_trait(
58 krate: CrateId, 58 krate: CrateId,
59 ty: InEnvironment<&Canonical<Ty>>, 59 ty: InEnvironment<&Canonical<Ty>>,
60) -> Option<Canonical<Ty>> { 60) -> Option<Canonical<Ty>> {
61 let _p = profile::span("deref_by_trait");
61 let deref_trait = match db.lang_item(krate, "deref".into())? { 62 let deref_trait = match db.lang_item(krate, "deref".into())? {
62 LangItemTarget::TraitId(it) => it, 63 LangItemTarget::TraitId(it) => it,
63 _ => return None, 64 _ => return None,
@@ -85,7 +86,10 @@ fn deref_by_trait(
85 environment: ty.environment.clone(), 86 environment: ty.environment.clone(),
86 }, 87 },
87 }; 88 };
88 if db.trait_solve(krate, implements_goal).is_none() { 89 if {
90 let _p = profile::span("db.trait_solve");
91 db.trait_solve(krate, implements_goal).is_none()
92 } {
89 return None; 93 return None;
90 } 94 }
91 95