Rename ty_error_with_guaranteed to ty_error, ty_error to ty_error_misc

This commit is contained in:
Michael Goulet 2023-02-22 22:23:10 +00:00
parent 1e7ef03b40
commit 298ae8c721
32 changed files with 121 additions and 140 deletions

View file

@ -156,7 +156,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
infcx.tcx,
)
});
prev.ty = infcx.tcx.ty_error_with_guaranteed(guar);
prev.ty = infcx.tcx.ty_error(guar);
}
// Pick a better span if there is one.
// FIXME(oli-obk): collect multiple spans for better diagnostics down the road.
@ -248,7 +248,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
origin: OpaqueTyOrigin,
) -> Ty<'tcx> {
if let Some(e) = self.tainted_by_errors() {
return self.tcx.ty_error_with_guaranteed(e);
return self.tcx.ty_error(e);
}
let definition_ty = instantiated_ty
@ -261,7 +261,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
origin,
instantiated_ty.span,
) {
return self.tcx.ty_error_with_guaranteed(guar);
return self.tcx.ty_error(guar);
}
// Only check this for TAIT. RPIT already supports `tests/ui/impl-trait/nested-return-type2.rs`
@ -326,7 +326,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
definition_ty
} else {
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors, None);
self.tcx.ty_error_with_guaranteed(reported)
self.tcx.ty_error(reported)
}
}
}

View file

@ -276,7 +276,7 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
.sess
.delay_span_bug(span, &format!("failed to normalize {:?}", ty));
TypeOpOutput {
output: self.infcx.tcx.ty_error_with_guaranteed(guar),
output: self.infcx.tcx.ty_error(guar),
constraints: None,
error_info: None,
}

View file

@ -239,7 +239,7 @@ pub(crate) fn type_check<'mir, 'tcx>(
decl.hidden_type.span,
&format!("could not resolve {:#?}", hidden_type.ty.kind()),
);
hidden_type.ty = infcx.tcx.ty_error_with_guaranteed(reported);
hidden_type.ty = infcx.tcx.ty_error(reported);
}
(opaque_type_key, (hidden_type, decl.origin))
@ -531,7 +531,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
if place_ty.variant_index.is_none() {
if let Err(guar) = place_ty.ty.error_reported() {
assert!(self.errors_reported);
return PlaceTy::from_ty(self.tcx().ty_error_with_guaranteed(guar));
return PlaceTy::from_ty(self.tcx().ty_error(guar));
}
}
place_ty = self.sanitize_projection(place_ty, elem, place, location, context);
@ -763,7 +763,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
fn error(&mut self) -> Ty<'tcx> {
self.errors_reported = true;
self.tcx().ty_error()
self.tcx().ty_error_misc()
}
fn get_ambient_variance(&self, context: PlaceContext) -> ty::Variance {