1
Fork 0

require an ErrorGuaranteed to taint infcx with errors

This commit is contained in:
Boxy 2022-11-18 11:30:21 +00:00
parent 1c48039a87
commit 9ed348376f
15 changed files with 94 additions and 59 deletions

View file

@ -197,7 +197,7 @@ fn do_mir_borrowck<'tcx>(
// Gather the upvars of a closure, if any.
let tables = tcx.typeck_opt_const_arg(def);
if let Some(e) = tables.tainted_by_errors {
infcx.set_tainted_by_errors();
infcx.set_tainted_by_errors(e);
errors.set_tainted_by_errors(e);
}
let upvars: Vec<_> = tables

View file

@ -303,7 +303,10 @@ pub(crate) fn compute_regions<'cx, 'tcx>(
if !nll_errors.is_empty() {
// Suppress unhelpful extra errors in `infer_opaque_types`.
infcx.set_tainted_by_errors();
infcx.set_tainted_by_errors(infcx.tcx.sess.delay_span_bug(
body.span,
"`compute_regions` tainted `infcx` with errors but did not emit any errors",
));
}
let remapped_opaque_tys = regioncx.infer_opaque_types(&infcx, opaque_type_values);