Unnamed repository; edit this file 'description' to name the repository.
Merge #10399
10399: minor: don't drop binders when doing autoderef r=lnicola a=iDawer This fixes #10396 panic introduced in #10373 Co-authored-by: Dawer <[email protected]>
bors[bot] 2021-09-30
parent 12fe0e4 · parent df4bb02 · commit 73562aa
-rw-r--r--crates/hir/src/lib.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index ed1776640c..ff795d85be 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -2504,8 +2504,7 @@ impl Type {
pub fn autoderef<'a>(&'a self, db: &'a dyn HirDatabase) -> impl Iterator<Item = Type> + 'a {
// There should be no inference vars in types passed here
- let ty = hir_ty::replace_errors_with_variables(&self.ty).value;
- let canonical = Canonical { value: ty, binders: CanonicalVarKinds::empty(&Interner) };
+ let canonical = hir_ty::replace_errors_with_variables(&self.ty);
let environment = self.env.env.clone();
let ty = InEnvironment { goal: canonical, environment };
autoderef(db, Some(self.krate), ty)