aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/autoderef.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/autoderef.rs')
-rw-r--r--crates/hir_ty/src/autoderef.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/hir_ty/src/autoderef.rs b/crates/hir_ty/src/autoderef.rs
index dc5fc759a..5e3c018a8 100644
--- a/crates/hir_ty/src/autoderef.rs
+++ b/crates/hir_ty/src/autoderef.rs
@@ -131,7 +131,7 @@ fn deref_by_trait(
131 // new variables in that case 131 // new variables in that case
132 132
133 for i in 1..vars.0.binders.len(&Interner) { 133 for i in 1..vars.0.binders.len(&Interner) {
134 if vars.0.value[i - 1].interned(&Interner) 134 if vars.0.value.at(&Interner, i - 1).assert_ty_ref(&Interner).interned(&Interner)
135 != &TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, i - 1)) 135 != &TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, i - 1))
136 { 136 {
137 warn!("complex solution for derefing {:?}: {:?}, ignoring", ty.goal, solution); 137 warn!("complex solution for derefing {:?}: {:?}, ignoring", ty.goal, solution);
@@ -139,7 +139,12 @@ fn deref_by_trait(
139 } 139 }
140 } 140 }
141 Some(Canonical { 141 Some(Canonical {
142 value: vars.0.value[vars.0.value.len() - 1].clone(), 142 value: vars
143 .0
144 .value
145 .at(&Interner, vars.0.value.len(&Interner) - 1)
146 .assert_ty_ref(&Interner)
147 .clone(),
143 binders: vars.0.binders.clone(), 148 binders: vars.0.binders.clone(),
144 }) 149 })
145 } 150 }