Avoid taking reference of &TyKind

This commit is contained in:
Michael Goulet 2024-08-25 16:02:11 -04:00
parent 89103466d7
commit 48f43fa0ed
14 changed files with 18 additions and 18 deletions

View file

@ -1035,9 +1035,9 @@ fn find_vtable_types_for_unsizing<'tcx>(
}
};
match (&source_ty.kind(), &target_ty.kind()) {
match (source_ty.kind(), target_ty.kind()) {
(&ty::Ref(_, a, _), &ty::Ref(_, b, _) | &ty::RawPtr(b, _))
| (&ty::RawPtr(a, _), &ty::RawPtr(b, _)) => ptr_vtable(*a, *b),
| (&ty::RawPtr(a, _), &ty::RawPtr(b, _)) => ptr_vtable(a, b),
(&ty::Adt(def_a, _), &ty::Adt(def_b, _)) if def_a.is_box() && def_b.is_box() => {
ptr_vtable(source_ty.boxed_ty(), target_ty.boxed_ty())
}