creating a TypeErrCtxt
should only be possible if we emit an error
#108810
Labels
A-type-system
Area: Type system
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
E-medium
Call for participation: Medium difficulty. Experience needed to fix: Intermediate.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
there are a lot of methods on
TypeErrCtxt
which should only be used for diagnostics. To assert that this is the case we should emit adelay_span_bug
when creating (or probably when dropping so that-Ztreat-err-as-bug
keeps working nicely) this context.This means that we can't use
infcx.err_ctxt().check_region_obligations_and_report_errors()
as that creates aTypeErrCtxt
even though we don't emit any error.Its probably easiest to use the same split as
select_all_or_error
, always usingresolve_regions
which returns a#[must_use]
list of errors and then manually callingreport_region_errors
The text was updated successfully, but these errors were encountered: