aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/hir_ty/src/autoderef.rs3
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 {