From df4bb02b6f73e924629deb6e2a62e39367ad4f3a Mon Sep 17 00:00:00 2001 From: Dawer <7803845+iDawer@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:57:15 +0500 Subject: [PATCH] minor: don't drop binders when doing autoderef --- crates/hir/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index ed1776640cf..ff795d85be4 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 + '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)