1
Fork 0

Move ty::Error branch into super_combine_tys

This commit is contained in:
Michael Goulet 2024-10-04 11:56:45 -04:00
parent df1b5d3cc2
commit 09da2ebd63
10 changed files with 12 additions and 81 deletions

View file

@ -43,6 +43,11 @@ impl<'tcx> InferCtxt<'tcx> {
debug_assert!(!b.has_escaping_bound_vars());
match (a.kind(), b.kind()) {
(&ty::Error(e), _) | (_, &ty::Error(e)) => {
self.set_tainted_by_errors(e);
return Ok(Ty::new_error(self.tcx, e));
}
// Relate integral variables to other types
(&ty::Infer(ty::IntVar(a_id)), &ty::Infer(ty::IntVar(b_id))) => {
self.inner.borrow_mut().int_unification_table().union(a_id, b_id);

View file

@ -183,11 +183,6 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, 'tcx> {
)?;
}
(&ty::Error(e), _) | (_, &ty::Error(e)) => {
infcx.set_tainted_by_errors(e);
return Ok(Ty::new_error(self.cx(), e));
}
(
&ty::Alias(ty::Opaque, ty::AliasTy { def_id: a_def_id, .. }),
&ty::Alias(ty::Opaque, ty::AliasTy { def_id: b_def_id, .. }),