Drive by: handle references in same_type_modulo_infer

This commit is contained in:
Esteban Kuber 2021-12-15 23:25:03 +00:00
parent 1c85987274
commit b09420f95a

View File

@ -333,6 +333,9 @@ pub fn same_type_modulo_infer<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool {
)
| (&ty::Infer(ty::InferTy::TyVar(_)), _)
| (_, &ty::Infer(ty::InferTy::TyVar(_))) => true,
(&ty::Ref(reg_a, ty_a, mut_a), &ty::Ref(reg_b, ty_b, mut_b)) => {
reg_a == reg_b && mut_a == mut_b && same_type_modulo_infer(ty_a, ty_b)
}
_ => a == b,
}
}