diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/hir_ty/src/autoderef.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/hir_ty/src/autoderef.rs b/crates/hir_ty/src/autoderef.rs index 71bc436e6..6d2cf4619 100644 --- a/crates/hir_ty/src/autoderef.rs +++ b/crates/hir_ty/src/autoderef.rs | |||
@@ -36,6 +36,7 @@ pub(crate) fn deref( | |||
36 | krate: CrateId, | 36 | krate: CrateId, |
37 | ty: InEnvironment<&Canonical<Ty>>, | 37 | ty: InEnvironment<&Canonical<Ty>>, |
38 | ) -> Option<Canonical<Ty>> { | 38 | ) -> Option<Canonical<Ty>> { |
39 | let _p = profile::span("deref"); | ||
39 | if let Some(derefed) = builtin_deref(&ty.goal.value) { | 40 | if let Some(derefed) = builtin_deref(&ty.goal.value) { |
40 | Some(Canonical { value: derefed, binders: ty.goal.binders.clone() }) | 41 | Some(Canonical { value: derefed, binders: ty.goal.binders.clone() }) |
41 | } else { | 42 | } else { |
@@ -56,6 +57,7 @@ fn deref_by_trait( | |||
56 | krate: CrateId, | 57 | krate: CrateId, |
57 | ty: InEnvironment<&Canonical<Ty>>, | 58 | ty: InEnvironment<&Canonical<Ty>>, |
58 | ) -> Option<Canonical<Ty>> { | 59 | ) -> Option<Canonical<Ty>> { |
60 | let _p = profile::span("deref_by_trait"); | ||
59 | let deref_trait = match db.lang_item(krate, "deref".into())? { | 61 | let deref_trait = match db.lang_item(krate, "deref".into())? { |
60 | LangItemTarget::TraitId(it) => it, | 62 | LangItemTarget::TraitId(it) => it, |
61 | _ => return None, | 63 | _ => return None, |
@@ -83,7 +85,10 @@ fn deref_by_trait( | |||
83 | environment: ty.environment.clone(), | 85 | environment: ty.environment.clone(), |
84 | }, | 86 | }, |
85 | }; | 87 | }; |
86 | if db.trait_solve(krate, implements_goal).is_none() { | 88 | if { |
89 | let _p = profile::span("db.trait_solve"); | ||
90 | db.trait_solve(krate, implements_goal).is_none() | ||
91 | } { | ||
87 | return None; | 92 | return None; |
88 | } | 93 | } |
89 | 94 | ||