From 3390e738164b0c112a028f3967bf13915023e167 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 14 Apr 2021 16:59:08 +0300 Subject: [PATCH] We need to go deeper --- crates/hir_ty/src/autoderef.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/hir_ty/src/autoderef.rs b/crates/hir_ty/src/autoderef.rs index 7afa2d5cef5..eae0ad949fe 100644 --- a/crates/hir_ty/src/autoderef.rs +++ b/crates/hir_ty/src/autoderef.rs @@ -58,6 +58,7 @@ fn deref_by_trait( krate: CrateId, ty: InEnvironment<&Canonical>, ) -> Option> { + let _p = profile::span("deref_by_trait"); let deref_trait = match db.lang_item(krate, "deref".into())? { LangItemTarget::TraitId(it) => it, _ => return None, @@ -85,7 +86,10 @@ fn deref_by_trait( environment: ty.environment.clone(), }, }; - if db.trait_solve(krate, implements_goal).is_none() { + if { + let _p = profile::span("db.trait_solve"); + db.trait_solve(krate, implements_goal).is_none() + } { return None; }