diff options
author | Kirill Bulatov <[email protected]> | 2021-04-14 15:15:37 +0100 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2021-04-14 15:15:37 +0100 |
commit | 75a2605361e497cdb6f8c8a4056a6ecd1e35ad68 (patch) | |
tree | 359cb4c3a3ef739ff9fa4a84987f5354e1bde679 /crates/hir_ty/src/autoderef.rs | |
parent | 3390e738164b0c112a028f3967bf13915023e167 (diff) |
Better places for spans
Diffstat (limited to 'crates/hir_ty/src/autoderef.rs')
-rw-r--r-- | crates/hir_ty/src/autoderef.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/hir_ty/src/autoderef.rs b/crates/hir_ty/src/autoderef.rs index eae0ad949..6d2cf4619 100644 --- a/crates/hir_ty/src/autoderef.rs +++ b/crates/hir_ty/src/autoderef.rs | |||
@@ -24,10 +24,8 @@ pub fn autoderef<'a>( | |||
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 { |
27 | let _p = profile::span("autoderef"); | ||
28 | let InEnvironment { goal: ty, environment } = ty; | 27 | let InEnvironment { goal: ty, environment } = ty; |
29 | successors(Some(ty), move |ty| { | 28 | successors(Some(ty), move |ty| { |
30 | let _p = profile::span("autoderef.step"); | ||
31 | deref(db, krate?, InEnvironment { goal: ty, environment: environment.clone() }) | 29 | deref(db, krate?, InEnvironment { goal: ty, environment: environment.clone() }) |
32 | }) | 30 | }) |
33 | .take(AUTODEREF_RECURSION_LIMIT) | 31 | .take(AUTODEREF_RECURSION_LIMIT) |
@@ -38,6 +36,7 @@ pub(crate) fn deref( | |||
38 | krate: CrateId, | 36 | krate: CrateId, |
39 | ty: InEnvironment<&Canonical<Ty>>, | 37 | ty: InEnvironment<&Canonical<Ty>>, |
40 | ) -> Option<Canonical<Ty>> { | 38 | ) -> Option<Canonical<Ty>> { |
39 | let _p = profile::span("deref"); | ||
41 | if let Some(derefed) = builtin_deref(&ty.goal.value) { | 40 | if let Some(derefed) = builtin_deref(&ty.goal.value) { |
42 | Some(Canonical { value: derefed, binders: ty.goal.binders.clone() }) | 41 | Some(Canonical { value: derefed, binders: ty.goal.binders.clone() }) |
43 | } else { | 42 | } else { |