From 96756f1b1df4729fd00ca96a59971b3997c91934 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 5 Apr 2021 22:08:16 +0200 Subject: Add Lifetime to TyKind::Ref --- crates/hir_ty/src/infer/coerce.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/infer/coerce.rs') diff --git a/crates/hir_ty/src/infer/coerce.rs b/crates/hir_ty/src/infer/coerce.rs index 32c273afc..d6c48870a 100644 --- a/crates/hir_ty/src/infer/coerce.rs +++ b/crates/hir_ty/src/infer/coerce.rs @@ -81,7 +81,7 @@ impl<'a> InferenceContext<'a> { // `&T` -> `*const T` // `&mut T` -> `*mut T`/`*const T` (TyKind::Ref(.., substs), &TyKind::Raw(m2 @ Mutability::Not, ..)) - | (TyKind::Ref(Mutability::Mut, substs), &TyKind::Raw(m2, ..)) => { + | (TyKind::Ref(Mutability::Mut, _, substs), &TyKind::Raw(m2, ..)) => { from_ty = TyKind::Raw(m2, substs.clone()).intern(&Interner); } @@ -111,7 +111,9 @@ impl<'a> InferenceContext<'a> { // Auto Deref if cannot coerce match (from_ty.kind(&Interner), to_ty.kind(&Interner)) { // FIXME: DerefMut - (TyKind::Ref(_, st1), TyKind::Ref(_, st2)) => self.unify_autoderef_behind_ref(st1, st2), + (TyKind::Ref(.., st1), TyKind::Ref(.., st2)) => { + self.unify_autoderef_behind_ref(st1, st2) + } // Otherwise, normal unify _ => self.unify(&from_ty, to_ty), -- cgit v1.2.3