Auto merge of #108369 - compiler-errors:ty-error-more, r=BoxyUwU

Use `tcx.ty_error_with_guaranteed` in more places, rename variants

1. Use `ty_error_with_guaranteed` more so we don't delay so many span bugs
2. Rename `ty_error_with_guaranteed` to `ty_error`, `ty_error` to `ty_error_misc`. This is to incentivize using the former over the latter in cases where we already are witness to a `ErrorGuaranteed` token.

Second commit is just name replacement, so the first commit can be reviewed on its own with more scrutiny.
This commit is contained in:
bors 2023-02-23 09:20:10 +00:00
commit 07c993eba8
33 changed files with 371 additions and 310 deletions

View file

@ -126,7 +126,7 @@ impl<'tcx> TypeRelation<'tcx> for Sub<'_, '_, 'tcx> {
(&ty::Error(e), _) | (_, &ty::Error(e)) => {
infcx.set_tainted_by_errors(e);
Ok(self.tcx().ty_error_with_guaranteed(e))
Ok(self.tcx().ty_error(e))
}
(