Skip to content

Commit f43edb2

Browse files
committed
Fix remaining interned_mut call
1 parent 0f058d6 commit f43edb2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

crates/hir_ty/src/infer/coerce.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ impl<'a> InferenceContext<'a> {
7171
}
7272

7373
// Pointer weakening and function to pointer
74-
match (from_ty.interned_mut(), to_ty.kind(&Interner)) {
74+
match (from_ty.kind(&Interner), to_ty.kind(&Interner)) {
7575
// `*mut T` -> `*const T`
76+
(TyKind::Raw(m1, inner), TyKind::Raw(m2 @ Mutability::Not, ..)) => {
77+
from_ty = TyKind::Raw(*m2, inner.clone()).intern(&Interner);
78+
}
7679
// `&mut T` -> `&T`
77-
(TyKind::Raw(m1, ..), TyKind::Raw(m2 @ Mutability::Not, ..))
78-
| (TyKind::Ref(m1, ..), TyKind::Ref(m2 @ Mutability::Not, ..)) => {
79-
*m1 = *m2;
80+
(TyKind::Ref(m1, lt, inner), TyKind::Ref(m2 @ Mutability::Not, ..)) => {
81+
from_ty = TyKind::Ref(*m2, lt.clone(), inner.clone()).intern(&Interner);
8082
}
8183
// `&T` -> `*const T`
8284
// `&mut T` -> `*mut T`/`*const T`

0 commit comments

Comments
 (0)